Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how do i convert ascii to char

Status
Not open for further replies.

SQL2KDBA69

Programmer
Feb 4, 2004
227
0
0
US
I need to convert ascii charcode 182 to a char.

in vb it was just chr(182) but i dont know how to do it in c#

thanks in advance.
 
is this what you need?
Code:
char num182 = (char)182;

Age is a consequence of experience
 
FYI:
182 is in the ANSI range, not the ASCII range of allowable values (ASCII is 0..127)

Also, converting it to an ANSI value will depend on which codepage you intend to use it with. 182 may result in different character representation (glyphs) depending on if you're using the original DOS OEM codepage, or the codepage for Thailand.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Beyond what's already been mentioned, any character conversion needs would be available in the System.Text namespace; refer to System.Text.ASCIIEncoding.

---------------------------------------
A picture is worth 2,000 bytes.
---------------------------------------
 
Thanks but i got it. Convert.ToChar(182);

worked fine for me.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top