Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

string contains js

var str = "foobar"
var regex = /foo/g;
if (str.search(regex) !== -1) {
  alert("string conains foo!")
}
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #string #js
ADD COMMENT
Topic
Name
8+5 =