字符串反转

/**
* 字符串反转
* @param s
* @return
*/
public static String reverse(String s) {
char[] array = s.toCharArray();
String reverse = "";
for (int i = array.length - 1; i >= 0; i--)
reverse += array[i];
return reverse;
}

posted @ 2016-09-26 10:13  扛着锄头进城  阅读(99)  评论(0编辑  收藏  举报