javascript if contains character
const string = "foo";
const 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)
Also in JavaScript:
- get platform node
- expo app.json
- fibonacci series in javascript in range using document.getelementbyid
- daysinmonth javascript
- dockerfile for nodejs
- bodyparser express
- react native textinput not show cursor
- react native dropdown
- concat array javascript
- libuv nodejs
- android studio react native plugins
- js combine 2 array to object key value
- 1. Write regular expression to describe a languages consist of strings made of even numbers a and b. CO1 K3
- refresh a div jquery
- font awesome react
- js generate list of names with forloop
- json in listview flutter
- react native background image
- angular formData print values
- add webpack to react project
- socket emit to specific room using nodejs socket.io
- vue-js-toggle-button config
- show password fa-eye javascript
- cli run js