Possible Duplicate:
Is there a simpler way to do this if statement in C#
I have this code:
while ((txtSource.Text[startPos].ToString() == " ") || 
       (txtSource.Text[startPos].ToString() == ",") || 
       (txtSource.Text[startPos].ToString() == ".")))
        {
            // do something
        }
is there any way to do the above like for instance:
while (!txtSource.Text[startPos].ToString() in (" ",",","."))
                while ((new char[] {' ', ',', '.'}).Contains(txtSource.Text[startPos]))
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With