Is there a more elegant way to accomplish this.
I have a string, where I would like to split and use individually in an if statement. For example:
string people = "John;Joe;Jane;Mike";
string[] names = people.Split(';');
if(person == "John" || person == "Joe" || person == "Jane" || person == "Mike")
{
....
}
else
{
....
}
There’s a better way of doing this, I guess.
Thanks.
Collections are your friends 🙂