Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const text = "Hola Crack de la Programación !";
- const searchWord = "Crack";
- function findWord(searchWord, text) {
- return RegExp('\\b'+ searchWord +'\\b').test(text)
- }
- console.log(findWord(searchWord, text));
- // Output: true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement