java 字符串 五重复 数据重组

ArrayList<String> list = new ArrayList<String>(); list.add(String.valueOf(chs.toCharArray()[chs.length()-1])); if(chs.length() <= 1){ return list; } int length = chs.length(); for(int i=0; i<length-1; i++){ int count = list.size(); for(int j=0; j<count; j++){ StringBuffer sb = new StringBuffer(); sb.append(chs.toCharArray()[i]); sb.append(list.get(j)); list.add(sb.toString()); } list.add(String.valueOf(chs.toCharArray()[i])); } return list;

你可能感兴趣的:(java,list)