Partially match strings in case of List.contains(String)

后端 未结 9 866
夕颜
夕颜 2020-12-10 11:23

I have a List

List list = new ArrayList();
list.add(\"ABCD\");
list.add(\"EFGH\");
list.add(\"IJ KL\")         


        
9条回答
  •  暖寄归人
    2020-12-10 12:11

    Perhaps you want to put each String group into a HashSet, and by fragment, I mean don't add "IJ KL" but rather add "IJ" and "KL" separately. If you need both the list and this search capabilities, you may need to maintain two collections.

提交回复
热议问题