Skip to content
bagley2014 edited this page Nov 12, 2021 · 1 revision

Verbatim strings should only be used with certain special characters.

Verbatim strings allow a programmer to include newlines, backslashes, and double quotes without having to escape them with a backslash. Unless at least one of these characters are being used in a verbatim string, a regular string should be used instead.

// unnecessarily verbose
string helloWorld = @"hello world";

// preferred
string helloWorld = "hello world";
Clone this wiki locally