字符串转义字符有什么问题?

时间:2016-09-26 21:56:17

标签: ios swift escaping

以下表达

let qs = "\' \(loggedInUserSettingRecordName!) \'";

这样绘制出来:

(lldb) po qs
"\' 10208273026137463 \'"

为什么呢? Swift文档说:

Special Characters in String Literals

    String literals can include the following special characters:

        The escaped special characters \0 (null character), \\ (backslash), \t (horizontal tab), \n (line feed), \r (carriage return), \" (double quote) and \' (single quote)

没有逃脱尝试:

let qs = "' \(loggedInUserSettingRecordName!) '";

结果:

(lldb) po qs
"\' 10208273026137463 \'"

0 个答案:

没有答案