“JavaScript String Search ()” Kode Jawaban

JS String Search

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

Cari string JavaScript

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

Jawaban yang mirip dengan “JavaScript String Search ()”

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya