天天一道LeetCode--344. Reverse String

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

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

 

public class Solution {
    public String reverseString(String s) {
        StringBuilder sb=new StringBuilder();
        sb.append(s);
        return sb.reverse().toString();
    }
}
相關文章
相關標籤/搜索