Hex to Ascii conversion

Hex to Ascii conversion

The following code sample converts the hex string to ascii codes. 

//You can use the Convert.ToInt32(string, base) to get the number value of a hexadecimal string
int n = Convert.ToInt32(”FF”, 16);
//To convert it to a character, simply cast the integer to char
char c = (char)n;
//To convert an integer to character the function Convert.ToChar() can also be used.
char c = Convert.ToChar(n);

Leave a Reply

You must be logged in to post a comment.


All material @ copyrighted by chrisranjana.com. If you want to link to this article you are welcome to do so. Unauthorized publication is strictly prohibited. This developer tutorial website contains articles by Php programmers , Software developers, Mysql programmers and asp c# programmers. This website also contains ajax tutorials and advanced mysql sql stored procedures and functions tutorials and sample codes.