Reverse String

Write a function that takes a string as input and returns the string reversed.

Example:
Given s = "hello", return "olleh"

思路:直接转StringBuffer后reserve即可;

JAVA CODE

class Solution {
    public String reverseString(String s) {
        StringBuffer ss = new StringBuffer(s);
        return ss.reverse().toString();
    }
}
原文地址:https://www.cnblogs.com/baichangfu/p/7451309.html