优秀的编程知识分享平台

网站首页 > 技术文章 正文

「C#11」原始字符串 - New Raw string literals

nanyue 2024-09-15 23:29:39 技术文章 3 ℃

在定义字符串时,我们往往夹杂着很多的符号,换?还有空格,但过往这些都需要增加转移字符,但现在通过原始字符串可以让字符串定义更为简单,也更容易给?接受。

string longMessage = """
   This is a long message.
   It has several lines.
        Some are indented
                 more than others.
   Some should start at the first column.
   Some have "quoted text" in them.
   """;
最近发表
标签列表