.NET 3.5 has a Range too. Actually Enumerable.Range and returns an IEnumerable<int> .
The page associated with you is very outdated - it speaks of 3 as a "future version", and the static Enumerable class was called Sequence one moment before the release.
If you want to implement it yourself in C # 2 or later, this is easy: here is one:
IEnumerable<int> Range(int count) { for (int n = 0; n < count; n++) yield return n; }
You can easily write other methods that further list filter lists:
IEnumerable<int> Double(IEnumerable<int> source) { foreach (int n in source) yield return n * 2; }
But since you have 3.5, you can use the extension methods in System.Linq.Enumerable to do this:
var evens = Enumerable.Range(0, someLimit).Select(n => n * 2);
source share