使用StringBuilder类的reverse()方法来实现。
/** * Created by Frank */ public class StringRevChar { public static void main(String[] args) { String sh = "ABCDEFG"; System.out.println(sh + "->" + new StringBuilder(sh).reverse()); } }
使用StringBuilder类的reverse()方法来实现。
/** * Created by Frank */ public class StringRevChar { public static void main(String[] args) { String sh = "ABCDEFG"; System.out.println(sh + "->" + new StringBuilder(sh).reverse()); } }
转载于:https://www.cnblogs.com/frankyou/p/6042545.html