Monday, January 18, 2010

Anyone know a C Language expression to turn ASCII Control character into corresponding ASCII lowercase letter?

char LowerCase = 'a' + ControlCharacter - 1;





A control character (say ^z) is represented by a number equal to the position in the alphabet (in this case 26). Subtracting one from the control character gives the offset from the first character (a), so adding that value to the character 'a' will give you your desired result.Anyone know a C Language expression to turn ASCII Control character into corresponding ASCII lowercase letter?
usually there is a code for the small letter too...








try http://www.asciitable.com/

No comments:

Post a Comment