我想在文本文件中找到特定的单词并将该单词存储在列表数组中。我不知道它是如何实现或接近的。
1 回答

哆啦的时光机
TA贡献1779条经验 获得超6个赞
一个基本的解决方案:
public ArrayList getWords(String searchWord, String listOfWords){
ArrayList<String> foundWords = new ArrayList<>();
if (listOfWords.contains(searchWord)){
foundWords.add(searchWord);
}
return foundWords;
}
添加回答
举报
0/150
提交
取消