@ Prefix

This puts everything within the string declaration "as is"
Using a verbatim literal enables you to add newline characters and other special characters to your strings.
To include a speech mark in an verbatim string literal you need to include it twice.

string myString; 
myString = @"C:\temp"
System.Diagnostics.Trace.Write(myString); '= "C:\temp"

myString = @"My ""Temp\"" folder"
System.Diagnostics.Trace.Write(myString); '= "My "Temp" folder"

© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext