What is an alternative to using multiple if statements?

Like I have four if statements under one function that each do the same thing for different items. I want to have it in just one if statement, but I cannot figure out an or operator. I tried doing if (object == "string1" | "string2" | "string3"), but I can't use that for strings.

by KalriusX via /r/csharp

Leave a Reply