146
rated 0 times
[
151]
[
5]
/ answers: 1 / hits: 21425
/ 13 Years ago, mon, march 21, 2011, 12:00:00
How to exactly match a given string in a sentence.
For example if the sentence is
var sentence = A Google wave is basically a document which captures a communication
and the given string is
var inputString= Google Wave. I need to check the exact presence of Google Wave in the above sentence & return true or false.
I tried
if(sentence.match(inputString)==null){
alert(No such word combination found.);
return false;
}
This works even if someone enters Google W. I need a way to find the exact match. Please help
More From » javascript