Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

search in string array javascript

function searchStringInArray (str, strArray) {
    for (var j=0; j<strArray.length; j++) {
        if (strArray[j].match(str)) return j;
    }
    return -1;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #search #string #array #javascript
ADD COMMENT
Topic
Name
6+7 =