Answers for "find word in javascript string"

2

find word in javascript string

var str = "This is a test sentence";
var hasTest = str.includes("test");
Posted by: Guest on March-28-2022
0

find a word in string javascript

const string = "This is a very long string";
const match = string.match(/very/);
console.log(match) // ['very', index: 10, input: 'This is a very long string', groups: undefined]
Posted by: Guest on January-20-2022

Code answers related to "find word in javascript string"

Code answers related to "Javascript"

Browse Popular Code Answers by Language