Zho*_*len 0 c# string string-literals
我有一小段代码:
public static void Write(string filename){
string time = DateTime.Now.ToString("hh:mm tt");
int date = int.Parse(DateTime.Now.ToString("yyyyMMdd"));
string path = @"C:\Users\Public\" + filename;
}
Run Code Online (Sandbox Code Playgroud)
如果我调试并在路径设置后停止它看起来像 “C:\\\Users\\\Public\\\filename.txt”.
谁能告诉我为什么它有双斜线?'@'在这种情况下,标志是否真的搞乱了?
我怎么可能得到它 “C:\Users\Public\filename.txt”