使用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()); } }