Hi Everyone,
Can any one please provide a JavaScript function or Regexp for the below mentioned scenario.
For Example: my string is :
1) '
My String abc-s'.
I have array of items to match the word in the above string.
var items= ["abc", "def", "ghi"];
If the above string contains any of the array item then it has to return true.
In the above array of items not contain 'abc', so it has to return false.
2)
var items= ["abc-s", "def-s", "ghi-s"];
If the above string contains any of the above item then it has to return true.
What I have tried:
Hi Everyone,
Can any one please provide a JavaScript function or Regexp for the below mentioned scenario.
For Example: my string is :
1) 'My String abc-s'.
I have array of items to match the word in the above string.
<pre>var items= ["abc", "def", "ghi"];
If the above string contains any of the array item then it has to return true.
In the above array of items not contain 'abc', so it has to return false.
2)
var items= ["abc-s", "def-s", "ghi-s"];
If the above string contains any of the above item then it has to return true.