Scanner in = new Scanner(System.in);
String s;
s=in.next();
StringBuilder b = new StringBuilder(s);
if( b.reverse().toString().equals(s))
System.out.println("true");
else System.out.println("false");
java string字符串反转的方法
最新推荐文章于 2023-04-26 11:59:14 发布