IEnumerable.Skip()
takes in number of elements to skip rather than the index CS-W1093The Skip()
method takes in an int
parameter that denotes the number of elements to skip rather than the index of the element to skip.
Passing in 0
to this method is the same as saying "not to skip any element".
The correct syntax instead is Skip(1)
. Consider making the appropriate changes to ensure your program does not rely on flawed logic.
var rest = elements.Skip(0);
var rest = elements.Skip(1);