如何从字符串数组中删除相同的单词?这是我想使用的代码示例,但它不起作用
String[] wordList = outString.toString().split(", ");
for (int i = 0; i < wordList.length; i++) {
for (int j = 0; j < wordList.length; j++) {
if ((wordList[i].equals(wordList[j]))&&(j!=i)) {
wordList.remove(wordList[i]);
}
}
}