I have List<String> clr9, which has a known Count of nine.
What I want to know is how to shorthand something that goes on later in the code.
else if(clr9[0].Equals(clr9[1]) && clr9[0].Equals(clr9[2]) && clr9[0].Equals(clr9[3]))
I've already tried this:
else if(clr9[0].Equals(clr9[1].Equals(clr9[2].Equals(clr9[3]))))
but it doesn't seem to work. Is there any way I can avoid the ampersands? Basically just asking if there's a way to find out if all 4 strings are the same without cluttering up that if statement.
crlX.Skip(1).Take(3).All(str => str == clrX[0])