06-文件中的字符串常量

文件中的字符串常量 — Rust 语言之旅

内容来源 · Tour of Rust / Rust 语言之旅

原文链接: https://tourofrust.com/64_zh-cn.html

文件中的字符串常量

如果你需要使用大量文本,可以尝试用宏 include_str! 来从本地文件中导入文本到程序中:

1
let hello_html = include_str!("hello.html");
最后修改 August 21, 2026: 更新 (76fc81a2e)