package collection;
public class HashMapDemo01 {
public static void main(String args[]) {
System.out.println(solve("abcd"));
}
public static String solve(String str) {
String result = "";
for (int i = str.length()-1; i >= 0; i--) {
result += str.charAt(i);
}
return result;
}
}
【娱乐】反转字符串
最新推荐文章于 2023-06-17 22:21:20 发布