C# Language Literals char literals

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Example

char literals are defined by wrapping the value with single-quotes ':

char c = 'h';

Character literals may contain escape sequences. See String Escape Sequences

A character literal must be exactly one character long (after all escape sequences have been evaluated). Empty character literals are not valid. The default character (returned by default(char) or new char()) is '\0', or the NULL character (not to be confused with the null literal and null references).



Got any C# Language Question?