I have the following while statement:
while ((leftSide.Count-rightSide.Count!=-1)&&(leftSide.Count-rightSide.Count!= 0))
{
// Do stuff here
}
I would love to write this something like this:
while (leftSide.Count - rightSide.Count ! in [-1, 0])
{
// Do stuff here
}
but that is illegal syntax. I am wondering, is there some way to that? Some syntax I don't know?
I want to see if the difference of the counts in a set of numbers without having to re-include the whole left side of the statement again?
I suppose I could do this:
int x = leftSide.Count-rightSide.Count;
while ((x != -1) && (x != 0))
{
// Do stuff here
x = leftSide.Count-rightSide.Count;
}
but I would rather not.
If there is no way to do a "set" comparison does anyone know why? C# is such a full featured language that it seems odd to have something like this missing.