import java.util.*;
public class Reverse {
public String reverseString(String iniString) {
if (iniString == null || iniString.length() <= 0) {
return null;
}
StringBuilder str = new StringBuilder();
for (int i = 0; i < iniString.length(); i++) {
str = str.append(iniString.charAt(iniString.length() - 1 - i));
}
return str.toString();
}
}
编程:字符串翻转Java
最新推荐文章于 2024-11-07 10:15:41 发布