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
Either do it like you have done it, or it gets much more complex. There is a search structure called "trie" , but this is complex.
You could gain a bit by having an array of a- z pointing to the start position in your sorted ArrayList of the first letter. Then you only have to search within the words that start with the same letter.