C#: How to assign const chars by their hex values?

Hi all,

I know in C you can assign const chars like so:

const char cSpaceSymbol = 0x20;

What is the C# equivalent? I want to assign const chars based solely upon the hex value. Thanks in advance!
ehensensAsked:
Who is Participating?
 
mrjoltcolaConnect With a Mentor Commented:
Try:

char ch = (char)0x20;
0
 
ehensensAuthor Commented:
Or the decimal value, obviously.
0
 
ehensensAuthor Commented:
Didn't think it'd be that easy & quick, thanks!
0
 
mrjoltcolaCommented:
Welcome!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.