The method you’re looking for is indexOf (Documentation). Try the following
if (sentence.indexOf('Hello World') >= 0) {
alert('Yes');
} else {
alert('No');
}
The method you’re looking for is indexOf (Documentation). Try the following
if (sentence.indexOf('Hello World') >= 0) {
alert('Yes');
} else {
alert('No');
}