Search code examples
c#alphabet

Generating an array of letters in the alphabet


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 to do this.


Solution

  • I don't think there is a built in way, but I think the easiest would be

      char[] alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".ToCharArray();