Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1040
  • Last Modified:

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!
0
ehensens
Asked:
ehensens
  • 2
  • 2
1 Solution
 
ehensensAuthor Commented:
Or the decimal value, obviously.
0
 
mrjoltcolaCommented:
Try:

char ch = (char)0x20;
0
 
ehensensAuthor Commented:
Didn't think it'd be that easy & quick, thanks!
0
 
mrjoltcolaCommented:
Welcome!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now