I am trying to find the position of all occurrences of a string in another string that is not case sensitive.
For example, given the line:
I learned to play the Ukulele in Lebanon.
and le search string, I want to get an array:
[2, 25, 27, 33]
Both lines will be variables - i.e. I cannot hard code their values.
I realized that it was a simple task for regular expressions, but trying to find some time, I would be out of luck.
I found this example on how to do this using .indexOf() , but there certainly should be a more concise way to do this?
javascript string regex indexof
Bungle Aug 4 '10 at 10:45 a.m. 2010-08-04 22:45
source share