344. Reverse String - LeetCode

2016-08-17  本文已影响19人  deactivateuser

Write a function that takes a string as input and returns the string reversed.
Example: Given s = "hello", return "olleh".

public class Solution {
    public String reverseString(String s) {
        return  new StringBuilder(s).reverse().toString();
    }
}
上一篇 下一篇

猜你喜欢

热点阅读