Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何为字符串提供带有“-signs in as value”的多行文本?
我想将文件的内容声明为测试的静态字符串,问题是内容使用“”作为其值。
它看起来像这样:
PLCPort = "1" PLCBaudRate = "11600" PLCDataBits = "8" PLCStopBit = "0"
我已经尝试使用@""多线,但是“-标志”毁了我的一天。有没有办法在使用时逃避“-标志” @""?
@""
您可以"通过编写将字符放在逐字字符串文字中"":
"
""
@"I have a single double quote: ""!"