Skip to content
Advertisement

Search a string to find all the letters in JavaScript [closed]

I search for the word “i” in the text, but it only shows the first “i” and does not show the rest of “i” I want you to show me the whole text though Help me please

JavaScript
JavaScript

Advertisement

Answer

You can use String#indexOf with the fromIndex argument to continuously search for the string.

JavaScript
JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement