Converting ASCII and Characters

by Mar 6, 2009

To convert the ASCII value to a character, use type casting like this:

[char]65

To do the opposite and convert a character to its ascii value, use this:

[int][char]'A'

Here, the letter "A" is first converted into a Char type, then into an Integer value.

To process more than one character at a time, use arrays instead:

[int[]][char[]]'Hello'