coderABC

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

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

 

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

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

@"\\servername\share\folder"

 

"\\\\servername\\share\\folder"

  

posted on 2015-12-09 09:34  as798982083  阅读(687)  评论(0编辑  收藏  举报