ascii codes

I know this is a simple question but for the life of me, the light's not coming on this morning....

How do I return the printable equivalent of an ascii code   For example, the decimal representation of ascii code 65 is the capital "A".  I'm creating a spreadsheet like form where I want to dynamically return "A", "B", "C", etc.

I would like to do something like this:

for(int ctr = 65; ctr <= 90; ctr++) // print the alphabet
{
// TheAlphabet = // return the alpha equivalent of ctr
    Console.WriteLine("The Letter is " + TheAlphabet)
}

Any suggestions would be appreciated.

Thanks,

Dexter


Answer this question

ascii codes

  • A_C

    Cast the int ...

    string TheAlphabet = new string((Char)ctr, 1);

    Hope this helps,
    Josh Lindenmuth

  • Paul Cyr

    string s = Convert.ToChar(65).ToString();



  • ascii codes