如何在 Rust 中编写多行字符串?

问题描述:

是否可以写成这样:

fn main() {
    let my_string: &str = "Testing for new lines \
                           might work like this?";
}

如果我正在阅读 语言参考 正确,然后看起来应该可以工作.语言参考声明支持 \n 等(作为常见转义,用于在字符串中插入换行符),以及附加转义",包括 LF、CR 和 HT.

If I'm reading the language reference correctly, then it looks like that should work. The language ref states that \n etc. are supported (as common escapes, for inserting line breaks into your string), along with "additional escapes" including LF, CR, and HT.