Helephant Helephant - 8 days ago 6
C# Question

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.

Bob Bob
Answer

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

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