If I have a list with the following items
list[0] = "blach blah blah"
list[1] = "SELECT something"
list[2] = "some more text"
list[3] = "some more text"
How to find the index where the line begins with SELECT.
I can do list.indexOf("SELECT something");
But this is a dynamic list. SELECT somethingusually will not SELECT something. it can be SELECT somethingelseor whatever, but the first word will always be SELECT.
Is there a way to apply regex to indexOf search?
source
share