Is there an easy way to generate an array containing the letters of the alphabet in C#? It\'s not too hard to do it by hand, but I was wondering if there was a built in way
C# 3.0 :
char[] az = Enumerable.Range('a', 'z' - 'a' + 1).Select(i => (Char)i).ToArray(); foreach (var c in az) { Console.WriteLine(c); }
yes it does work even if the only overload of Enumerable.Range accepts int parameters ;-)