字符串反转

public static String reverse(String str){  
        return new StringBuilder(str).reverse().toString();  
    }

public void test09() {  
        String str = "hello";  
  
        for (int i = str.length() - 1; i >= 0; i--) {  
              
            char c = str.charAt(i);  
              
            System.out.print(c);  
        }  
    } 
posted on 2019-09-19 22:57  每天在路上2018  阅读(253)  评论(0编辑  收藏  举报