如何在字符串中包含引号
本文关键字:包含引 字符串 | 更新日期: 2023-09-27 18:20:50
我有一些字符串变量需要包含引号。不出所料,在"a string like this"
中放入"将结束字符串,然后创建一个新字符串。
例如:
writer.WriteLine("{"); //first line is ok
writer.WriteLine(" "profiles": { ");
// the word "profiles" not treated as just another part of the string
// but I need to write this text, quotes and all:
// "profiles": {
如何在字符串中加引号?
您需要逃离它们。
writer.WriteLine(" '"profiles'": { ");