C#中string类型前加@标志的作用

转自:http://stackoverflow.com/questions/4879152/c-sharp-before-a-string   (stackoverflow)

string字符串前加@意味着将整个字符串内容逐字翻译,字符串中的内容不会被分开解释,而是作为一个整体存在,举个栗子:

如果想要存储一个UNC地址,有两种写法,前一种更方便。

@"\servernamesharefolder"
"\\servername\share\folder"

  

原文地址:https://www.cnblogs.com/mengfff/p/5031817.html