I have an array with a lot of names: {'John Doe', 'Peter Shark', ...}
.
Now I would like to compare and match a string for e.g. 'This is your turn John Doe, pls do it'
and return the name(s), if the array contains it.
The string could be a long text.
I´ve tried it like this, but it do not work:
var searchStr = "This is your turn John Doe, pls do it"
var stringArray = ["John Doe", "Peter Shark"];
return (stringArray.indexOf(searchStr) > -1)