Ascii code

  • Thread starter Thread starter Claudio
  • Start date Start date
C

Claudio

How to get the ascii character from a decimal value, in C#?

I have a decimal value 8 and it returns de ascci code from 8.
 
I found this in the help documentation:

Returns the character associated with the specified character code.


Public Function Chr(ByVal CharCode As Integer) As Char
Public Function ChrW(ByVal CharCode As Integer) As Char


Parameters
CharCode

Required. An Integer expression representing the code point, or character
code, for the character. If CharCode is outside the valid range, an
ArgumentException error occurs. The valid range for Chr is 0 through 255,
and the valid range for ChrW is -32768 through 65535.

Regards,

Max

Sergey Bogdanov said:
char c = (char)8?


--
Sergey Bogdanov [.NET CF MVP, MCSD]
http://www.sergeybogdanov.com

How to get the ascii character from a decimal value, in C#?

I have a decimal value 8 and it returns de ascci code from 8.
 
Besides these being a VB thing and not C#, and while my memory is vague, I
recall something about them being slower than a manual implementation and
more importantly the CF implementation had slight differences from the
desktop implementation.

Cheers
Daniel
--
http://www.danielmoth.com/Blog/

Max Schneider said:
I found this in the help documentation:

Returns the character associated with the specified character code.


Public Function Chr(ByVal CharCode As Integer) As Char
Public Function ChrW(ByVal CharCode As Integer) As Char


Parameters
CharCode

Required. An Integer expression representing the code point, or character
code, for the character. If CharCode is outside the valid range, an
ArgumentException error occurs. The valid range for Chr is 0 through 255,
and the valid range for ChrW is -32768 through 65535.

Regards,

Max

Sergey Bogdanov said:
char c = (char)8?


--
Sergey Bogdanov [.NET CF MVP, MCSD]
http://www.sergeybogdanov.com

How to get the ascii character from a decimal value, in C#?

I have a decimal value 8 and it returns de ascci code from 8.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top