“string javascript berisi string” Kode Jawaban

JavaScript string berisi

var string = "foo",
    substring = "oo";

console.log(string.includes(substring));
Cautious Crane

string berisi dalam javascript

const string = "foo";
const substring = "oo";

console.log(string.includes(substring));
2 Programmers 1 Bug

string javascript berisi fungsi

s = "Hello world";
console.log(s.includes("world"));
Curious Cormorant

string javascript berisi string

var str = "We got a poop cleanup on isle 4.";
if(str.indexOf("poop") !== -1){
	alert("Not again");
}
//use indexOf (it returns position of substring or -1 if not found)
Grepper

JS String berisi

'Bandeira do Brasil'.includes('brasil'); // returns false
'Bandeira do Brasil'.includes('Brasil'); // returns true
GutoTrosla

JavaScript string berisi

var email = "[email protected]";
if(email.includes("@")){
  console.log("Email is valid");
}
else{
  console.log("Email is not valid");
}
// includes return boolean, if your string found => true else => false
Programming Is Fun

Jawaban yang mirip dengan “string javascript berisi string”

Pertanyaan yang mirip dengan “string javascript berisi string”

Lebih banyak jawaban terkait untuk “string javascript berisi string” di JavaScript

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya