Is there any way to know if an arraylist contains a piece of text?

前端 未结 5 1425
执笔经年
执笔经年 2021-01-15 11:35

I have an arraylist with several items. Let\'s say they are: \"DARK BROWN\", \"BLUE\", \"GREEN\",....

Is there any way to look for if there\'s the string \"DARK\" in

5条回答
  •  悲哀的现实
    2021-01-15 12:35

    Or you can use completly different approach. and wrap ArrayList and check upon list.add() for a match. And store it in some var for quick access. But if you have multiple values to search, then this approach is not good at all :).

提交回复
热议问题