这是按第二个字符对单词进行排序的排序方法,它不起作用(有人能说如何解决吗?
out = new StringTokenizer(input.toString());
n = out.countTokens();
List<String> wordList = new ArrayList<String>(n);
for (int i = 0; i < n; i++) {
wordList.add(out.nextToken());
}
Collections.sort(wordList, new Comparator<String>() {
public int compare(String o1, String o2) {
return compare(o1.substring(1, 2).compareTo(o2.substring(1, 2)));
}
});