javascript string contains character
var string = "foo",
substring = "oo";
console.log(string.includes(substring));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)if (your_string.indexOf('hello') > -1)
{
alert("hello found inside your_string");
}
Also in JavaScript:
- XML
- js delete all array items
- how to append the dropdown values by jquery each function
- vue for loop
- disable long press on chrome
- check is array javascript
- rest api node js with mysql
- jquery form data
- react lifecycle
- jquery visibility hidden show
- how to get a user input in js
- form data-request octobercms
- javascript template literals
- discord.js get username
- jspdf preview before download
- javascript get elements in both arrays
- how to get header in all the pages in visualforce page
- bind in javascript
- js remove form object by key
- remove text element jquery
- javascript date now
- parsefloat jquery
- excel date to javascript date
- button not exist js