How to get a variable of type char to have a value of ' in c#

c#

Solution

char c = '\'';

the backslash is called an escape character.

and if you want a backslash it's

char c = '\\';

Here's some more for good measure:

- \t - tab

- \n - new line

- \uXXXX - where XXXX is the hexadecimal value of a unicode character

Problem

A bit of a dumb one... but how do I get a variable of type char to have a value of `'`? e. g. ``` char c = '''; char a = 'A'; char b = 'B'; ```

Original source