Java, return if trimmed String in List contains String

后端 未结 7 2333
旧巷少年郎
旧巷少年郎 2020-12-04 17:52

In Java, I want to check whether a String exists in a List myList.

Something like this:

if(myList.contains(\"A\")){
    //         


        
相关标签:
7条回答
  • 2020-12-04 18:11

    You may be able to use an approximate string matching library to do this, e.g. SecondString, but that is almost certainly overkill - just use one of the for-loop answers provided instead.

    0 讨论(0)
提交回复
热议问题