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

How to logout from a login page in asp.net -

Stack level too deep error after upgrade to rails 3.2 and ruby 1.9.3 -