search() in Javascript
👉search() in Javascript👈
<!DOCTYPE html>
<html>
<head>
<title>Test page</title>
<script type="text/javascript">
//search method actually returns the position of the word and
// if it doesn't find that word it will return -1.
var str= "HELLO WORLD WELCOME TO THE NEW GENERATION!!Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eveniet, saepe.Lorem ipsum dolor sit amet, consectetur adipisicing elit. Molestiae, dolorem.";
var b= str.search("TO");
console.log(b);
</script>
<html>
<head>
<title>Test page</title>
<script type="text/javascript">
//search method actually returns the position of the word and
// if it doesn't find that word it will return -1.
var str= "HELLO WORLD WELCOME TO THE NEW GENERATION!!Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eveniet, saepe.Lorem ipsum dolor sit amet, consectetur adipisicing elit. Molestiae, dolorem.";
var b= str.search("TO");
console.log(b);
</script>
</head>
<body>
<h1></h1>
</body>
</html>
Comments
Post a Comment
I WOULD APPRECIATE IF YOU LEAVE A COMMENT OR YOUR FEEDBACK HERE !!!