字符串反转

public static String reverse(String originStr) {  
        if(originStr == null || originStr.length() <= 1)   
            return originStr;  
        return reverse(originStr.substring(1)) + originStr.charAt(0);  
    } 

出处:https://www.cnblogs.com/roucheng/p/javatimu.html

posted @ 2018-07-21 13:25  天涯已可  阅读(93)  评论(0编辑  收藏  举报