How to convert ASCII to readable characters?
-
Hello everyone, I have an array which holds ASCII codes. How can I convert this to characters that I read?! ;P Thank you very much and have a great weekend. Khoramdin
Just cast the value as a char:
char letter = array[0];
You can set a char using a letter'a'
, an int52
, or a hex value0x00
Of course you'll want some kind of loop to do that, and use an array of chars. Infact, there may be something in the string class, i'll go look now. -- modified at 18:47 Saturday 1st December, 2007 Aha, i knew that encoder class was somewhere:string myText = System.Text.ASCIIEncoding.ASCII.GetString(array);
//array is an array of bytesMy current favourite word is: PIE! I have changed my name to my regular internet alias. But don't let the 'Genius' part fool you, you don't know what 'SK' stands for. -
The Undefeated
-
Just cast the value as a char:
char letter = array[0];
You can set a char using a letter'a'
, an int52
, or a hex value0x00
Of course you'll want some kind of loop to do that, and use an array of chars. Infact, there may be something in the string class, i'll go look now. -- modified at 18:47 Saturday 1st December, 2007 Aha, i knew that encoder class was somewhere:string myText = System.Text.ASCIIEncoding.ASCII.GetString(array);
//array is an array of bytesMy current favourite word is: PIE! I have changed my name to my regular internet alias. But don't let the 'Genius' part fool you, you don't know what 'SK' stands for. -
The Undefeated
Yeah they kinda hide it.
-
Yeah they kinda hide it.
PIEBALDconsult wrote:
they kinda hide it
It's fun finding little things like that.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
-
PIEBALDconsult wrote:
they kinda hide it
It's fun finding little things like that.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
It's best when someone writes an article explaining their new super-fast method for doing something just to be told, "just use a System.Something".