Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 138192

How can I find out if a word is in a given sentence? [duplicate]

$
0
0

I want to find out if a certain word is in a given sentence. If yes, then I want to return true, if not, then return false.

For example:

word = "big"

sentence 1: "Tom is my big brother."

This should return true.

sentence 2: "Sandra is very old."

This should return false.

sentence 3: "Ralph is the biggest."

This should return true.

How can I find out if a word is in a given sentence?


Viewing all articles
Browse latest Browse all 138192

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>