Get Letters in Alphabet with C#

Have you ever needed to do something with the letters of the alphabet? This is quite common in navigation systems where you have alot of data and need to break up things into sections alphabetically. You can always create an ArrayList and populate each section manually, but a better way is to just use the ASCII characters and put it into an array.

C# public ArrayList GetAlphabet() { ArrayList list = new ArrayList(); for (int i = 65; i <= 90; i++) { list.Add(((char)i).ToString()); } return list; }

VB.NET Public Function GetAlphabet() As ArrayList Dim list As New ArrayList() For i As Integer = 65 To 90 list.Add(CChar(i).ToString()) Next Return list End Function

POSTED BY Divergence Hosting on Mar 15 under C#

Leave a Comment

If you would like to make a comment, please fill out the form below.

Name (required)

Email (required)

Website

Comments

Copyright Divergence Hosting Technical Blog | Powered by WordPress | Using the GreenTech Theme

SEO Powered by Platinum SEO from Techblissonline