“Javascript string search ()” Respostas de código

Pesquisa de String JS

var str = "This is a test sentence";
var hasTest = str.includes("test");

if(hasTest == true){
	//do a thing 
}
Lazy Lemur

Javascript string search ()

let str = "Please locate where 'locate' occurs!";
str.search("locate");
naly moslih

Pesquise string javascript

"I love cats".indexOf("cat") //returns 7, the position of "cat"
Abraham Adamu

Respostas semelhantes a “Javascript string search ()”

Procure respostas de código populares por idioma

Procurar outros idiomas de código