public static String getStr(String source){ if(source==null||source.equals("")){ return ""; } if(source.length()==1){ return source; }else{ String temp = source.substring(0, source.length()-1); String value = source.substring(source.length()-1, source.length()); return value + getStr(temp); } }