lundi 2 juillet 2018

find a word in string that comes multiple times in java script?

i want to find a word in a string multiple times

For Example : var string = "my name is "xyz" and my school name is "xyz" and my area name is "xyz" "

i want to find the location of word "my " eg code tells me that word my comes in location 0 , 21 , 50 i also tried many other JS methods but no one can give the result




Aucun commentaire:

Enregistrer un commentaire