Fast multiple string compare
In c# is there a quick way to replace the following with more efficient code:
string letters = "a,b,c,d,e,f";
if (letters.Contains("a"))
{
return true;
}
if (letters.Contains("b"))
{
return true;
}
if (letters.Contains("c"))
{
return true;
}
I want to do away with having to have three compare lines of code.
Thanks!
No comments:
Post a Comment