Once again, in this series of posts I look at the parts of the .NET Framework that may seem trivial, but can help improve your code by making it easier to write and maintain. The index of all my past little wonders posts can be found here. Thanks for all of your patience while I’ve been dealing with other matters these last few weeks. I didn’t want to let my post slide a third week, so I decided to say a few words about a small static method in the Enumerable class from System.Linq.
Using Range() to generates a sequence of consecutive integers So, if we look in the Enumerable static class, where most of the linq extension methods are defined, we will also see a static method called Range() whose purpose is to generate a range of integers from a given start value and for a given count. It’s syntax looks like: Range(int start, int count) Returns a sequence of int from start to (start + count – 1). ...(Read whole news on source site)