C# Language Literals string 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

string literals are defined by wrapping the value with double-quotes ":

string s = "hello, this is a string literal";

String literals may contain escape sequences. See String Escape Sequences

Additionally, C# supports verbatim string literals (See Verbatim Strings). These are defined by wrapping the value with double-quotes ", and prepending it with @. Escape sequences are ignored in verbatim string literals, and all whitespace characters are included:

string s = @"The path is:
C:\Windows\System32";
//The backslashes and newline are included in the string


Got any C# Language Question?