How can I get a list of strings from "A:" to "Z:" in C#? Something like this:
List<string> list = new List<string>();
for (int i = 0; i < 26; i++)
{
list.Add(string.Format("{0}:", Convert.ToChar('A' + i));
}
Sorry I don't have VS available for verification right now to verify. By the way, is there web site available to interactive test snip of codes?
Well, not counting missing ')' at the end of list.Ad.... line, everything is ok, altough you could write it using a bit shorter notation
list.Add((char)('A' + i) + ":");