Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to check if a string contains a certain letter in js

// use the variable.includes() 
const myString = "hello world!"
if(myString.includes("hello")){
  // do something 
}else{
  //also do something
}
 
PREVIOUS NEXT
Tagged: #check #string #letter #js
ADD COMMENT
Topic
Name
2+2 =