string literals C# with Example



string literals C# with 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 

0 Comment's

Comment Form

Submit Comment