I know you can say SomeEnumerable.First()
. But there's no .Rest
.
I know I could write one, but I am wondering if I am missing something.
Related Question: Are there ruby equivalents to car, cdr, and cons?
For CDR
you can use Enumerable.Skip(1)
like:
var cdrResultQuery = someIEnumerable.Skip(1);
Consider following example:
IEnumerable<int> someIEnumerable = new List<int> {1, 2, 3, 4, 5};
var cdrResultQuery = someIEnumerable.Skip(1);
foreach (var i in cdrResultQuery)
{
Console.WriteLine(i);
}
and you will get:
2
3
4
5
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