Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to extract strings in array js

function search (array,string) {

    var arr= [];

    for (var i=0; i<array.length; i++) {
        if (array[i].match(string)){

          arr.push(i)

          return arr;
        }  
    }
      return -1;
  }

 search(array,'v_')
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #extract #strings #array #js
ADD COMMENT
Topic
Name
5+3 =