Check given word is present in Excel

Hi All,

I need to check if input string contains any of the word from datatable . if works fine for single word ,but fails if the datatable has multiple words in a row.

For eg let have datatable as

Col A
Order
Help
Do you

Inputstr = Hi How are you .

(This condition should give boolean value as false ,but it give true as “You” is in datatable).

Currently I split the input string and use linq.

dt_word.AsEnumerable.Any(Function(r) r.ItemArray.Any(Function(o) ArrInput.Any(Function(s) System.Text.RegularExpressions.Regex.IsMatch(o.ToString,“\b”+System.Text.RegularExpressions.Regex.Escape(s)+“\b”,System.Text.RegularExpressions.RegexOptions.IgnoreCase))))

@tharani.natarajan

Please try like this as you want to match each word but with whole cell

dt_word.AsEnumerable.Any(Function(r) r.ItemArray.Any(Function(o) Inputstr.Tolower.Trim.Contains(o.ToString.ToLower.Trim)))

cheers