java使用StringBuilder的方法反转字符串输出

public class FanZhuan {
public static void main(String[] args) {
/**第一种方法*/
String s = "987654321088123about我是谁";
System.out.println("直接输出:"+s);

StringBuilder b = new StringBuilder(s);
s = b.reverse().toString();
System.out.println("反转输出:"+s);
  }
}

猜你喜欢

转载自www.cnblogs.com/THEONLYLOVE/p/9116722.html