.contains method js code example
Example 1: js string contains
'Bandeira do Brasil'.includes('brasil'); // retorna false
Example 2: string contains js
var str = "foobar"
var regex = /foo/g;
if (str.search(regex) !== -1) {
alert("string conains foo!")
}