string includes substring javascript
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)
Also in JavaScript:
- javascript schleife
- how to make javascript function consise
- september
- jsdoc for express routes
- chess.js
- javascript percent to int
- check for substring javascript
- falsy values javascript
- get percentage of number javascript
- how to check if an array contains a number in javascript
- jquery get element by id
- how to get time and date from iso string javascript
- riverSizes javascript
- title case javascript
- functions in map javascript
- how to print console in javascript
- missing expression after unary operator '--'
- drop down listing in angular form
- discord.js command prompt notification
- jquery attr
- react router dom current path hook
- add new items in a select input using js
- javascript detect browser
- js loop backwards