string inp = "ABCD"; foreach (char c in inp.ToUpper()) { if (c >= 'A' && c <= 'Z') { Console.WriteLine("The \"number\" of '{0}' is {1}", c, c - 'A' + 1); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)