c# - Look for words in strings with LINQ -


c# or vb.net suggestion welcome.

i have following code:

 dim sometext = "stack on flow community"     dim someword = "over community"      if sometext.contains(someword)         response.write("word found.")     else         response.write("no word found.")     end if    function contains looks next words left right.   sometext.contains("over stack")  returns false sometext.contains("stack community")  returns false 

i want of these return true long there words exist in string.

is there existing function cover case regardless of words position in string?

words.split(' ').any(sometext.contains) 

Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -