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 learn.coderslang.com #
 
PREVIOUS NEXT
Tagged: #string #js
ADD COMMENT
Topic
Name
2+5 =