what best way check if string (of ints) within list of string?
e.g. check whether '1' in (1,2,9,10,11,15)
i had like:
if(listofstring.contains(radiolist.selectedvalue))
where radiolist.selectedvalue integer stored in string form.
i don't think above work because '1' match '11' in string.
any ideas?
thanks!
you can split array ','
character , using .contains()
.
string listofstring = "1,2,9,10,11,15"; string[] stringints = listofstring.split(','); if (stringints.contains(radiolist.selectedvalue.tostring())) { // ... }
Comments
Post a Comment