c# - How to check a string contains another string -


this question has answer here:

i have string of numbers separated commas ,how check if string contained in string .

for example :

if have string :

67,782,452,67632,9,155,323 

how check 155 in previous string using linq ?

i assume want check if 1 of items in string given string. split string first delimiter ,, use contains or any:

string[] items = "67,782,452,67632,9,155,323".split(','); bool contains = items.contains("155"); contains = items.any(i => == "155"); 

the problem contains-check on string "1550" contain "155".


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -