To
Creates a range of integers as an IEnumerable<Int32>.
Source
public static IEnumerable<int> To(this int first, int last) {
return Enumerable.Range(first, last - first + 1);
}
Example
var numbers = 1.To(10);
ExtensionMethod.NET Home of 880 C#, Visual Basic, F# and Javascript extension methods
Creates a range of integers as an IEnumerable<Int32>.
public static IEnumerable<int> To(this int first, int last) {
return Enumerable.Range(first, last - first + 1);
}
var numbers = 1.To(10);