Home > DeveloperSection > Interviews > How can I get the ASCII code for a character in C#?

Posted on    January-06-2011 12:00 AM

 C# C# 
Ratings:
 1 Answer(s)
  1009  View(s)
Rate this:

Mahesh Rawat
Mahesh Rawat

Total Post:138

Points:690
Posted on    January-06-2011 1:00 AM

Casting the char to an int will give you the ASCII value: char c = 'f';

System.Console.WriteLine((int)c);


Don't want to miss updates? Please click the below button!

Follow MindStick