A
ad
How to retrun a character with ascii code?
It is useChr(65) return 'A' in VB.NET.
What is the equivalent function in C#?
It is useChr(65) return 'A' in VB.NET.
What is the equivalent function in C#?
Hi Ad,
char[] characters = System.Text.Encoding.ASCII.GetChars(new byte[]
{65});
Yes, looks quite cumbersome and I wonder myself why there is no
overload for a single character (or was I just too lazy to dig MSDN
enough? ;-)
Oskar said:Hallo!
Hi Ad,
char[] characters = System.Text.Encoding.ASCII.GetChars(new byte[]
{65});
Yes, looks quite cumbersome and I wonder myself why there is no
overload for a single character (or was I just too lazy to dig MSDN
enough? ;-)
Why not Convert.ToChar(65) ?
Oskar Punz said:Hallo!
Hi Ad,
char[] characters = System.Text.Encoding.ASCII.GetChars(new byte[]
{65});
Yes, looks quite cumbersome and I wonder myself why there is no
overload for a single character (or was I just too lazy to dig MSDN
enough? ;-)
Why not Convert.ToChar(65) ?
Sincerely
Oskar
Hallo Oskar,
I think Convert.ToChar as well as (char)65 assume the Unicode
encoding, while the author has explicitly mentioned the ASCII one.
Yes, the character codes of the capital 'A' are the same in both of
the encodings, but this, in general, might be not true for other
character codes and other encodings.