Skip to content

章节《字符和字符串》中扩展字符串和分隔符中示例代码中缺少\ #1420

@walle9

Description

@walle9

Location

https://doc.swiftgg.team/documentation/the-swift-programming-language/stringsandcharacters

Description

章节《字符和字符串》中,扩展字符串和分隔符段落中,
在字符串字面值中,如果您需要某个字符的特殊效果,需使字符串中紧跟转义字符(\)后的井号(#)数量相匹配。例如,如果您的字符串是 #"Line 1\nLine 2"# 并且您想要换行,可以使用 #"Line 1#nLine 2"# 替代。同样,###"Line1###nLine2"### 也能实现换行效果。代码 ###"Line1###nLine2"### 缺少\,正确为###"Line1\###nLine2"###,应该是显示错误

Correction

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions