How can I find array items in a text string?
I don't know the array and I don't know the text. But when an array item is contained in the text then party!
var arrayString = 'apple | ape | soap',
text = "This a nice apple tree.";
var array = arrayString.split(" | ");
var matchedArrayItem = "..."; // please help on this
if(matchedArrayItem) {
$("body").append('The text contains the array item "'+ matchedArrayItem +'".');
}