How to find all occurrences of a character in a string. For example string is: “Hello world”
and user want to now the indexes of string where ‘L’ is present. Which is in example 2,3 and 9. How to find indexes like this in java-script/jquery ?
How to find all occurrences of a character in a string. For example string
Share
You can try something like the following code, from this answer: