string - C# "or" operator -


i have code:

if (textbox1.text == "one" || "two") 

i have tried use || , | add more strings, says cannot applied operands of type "bool" , "string". how can make work? thank you.

or alternatively :

var strings = new list<string>() {"one", "two", "thee", .... "n"}; if(strings.contains(textbox1.text)){ } 

Comments

Popular posts from this blog

PHP Error "Undefined index" -

C# List<> to xml -

javascript - Concatenate two fields in one in CRM 2011 -