Hi,
Is there any way in C# to get the ASCII code of a character like in VB.
VB: Dim n as Integer = Asc("D"c) 'return 68
I don't want to use Microsoft.VisualBasic for this task.
Thanks
You can use:
char D = 'D'; int n = (int)D;
Or the shorter: int n = (int)'D';
Reed Copsey, Jr. - http://reedcopsey.com If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".
Oh... Very Simple
Good to know that casting a character yields ASCII code!