we have $.inArray(searchString, array) function in jQuery, but this will look for the exact match of the string in the values present in the array. But how to check the string in the array like indexOf?
For e.g., Let us take the string "mark_zuck" and if the array looks like this, ["mark", "sheryl", "zuck"]. We can do this by using a loop comparing each value in array with the given string like,
for (i=0; i<array.length; i++) {
searchString.indexOf(array[i]);
}
I'm looking for a better way to implement this. Please help.