I was given a text. How can I search for a particular string in that and how many times it appears using JavaScript?
Text:
This is a boy . This boy is very smart . This boy does miracles.
So if I want search for string = "boy " .
How can I do that using JavaScript?
What I did ? I tried using search function of JavaScript. Is that right to use?
Thank you so much in advance!!!