C# or VB.NET suggestion are welcome.
I have the following code:
Dim someText = "Stack Over Flow Community"
Dim someWord = "Over Community"
If someText.Contains(someWord) Then
Response.Write("Word found.")
Else
Response.Write("No word found.")
End If
Function Contains looks only for next words from left to right.
someText.Contains("Over Stack") returns False
someText.Contains("Stack Community") returns False
I want all of these to return True as long as there are words that exist in the string.
Is there any existing function that cover any case regardless of words position in the string?
words.Split(' ').Any(someText.Contains)
someText.Split(' ').Intersect(someWord.Split(' ')).Any();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With