public static String
reverseString(String s) {
char[] tmp = s.toCharArray();
int i =
0, j = s.length() -
1;
while(i < j) {
char tmpChar = tmp[i];
tmp[i] = tmp[j];
tmp[j] = tmpChar;
i++;
j--;
}
return new String(tmp);
}
转载请注明原文地址: https://ju.6miu.com/read-1126111.html