1 个不稳定版本
0.1.1 | 2024 年 6 月 4 日 |
---|---|
0.1.0 |
|
#872 在 开发工具
318 每月下载量
5KB
多行字符串宏
这是一个简单的多行字符串 Rust 宏,它允许你以更易读的方式编写多行字符串。它允许任何组合的空格连接和换行连接的字符串。
用法
use multiline_str::multiline_str;
let s = multiline_str! {
"This is a line",
"and this line joins the previous one, with a space",
"and so does this one";
"But this line is separated by a newline",
"and this one joins the previous one, with a space";
"";
"This line is separated by two newlines"
};
println!("{}", s);
输出
This is a line and this line joins the previous one, with a space and so does this one
But this line is separated by a newline and this one joins the previous one, with a space
This line is separated by two newlines
贡献
如果你有任何建议、改进或错误报告,请随时提交问题或拉取请求。我总是很高兴收到反馈和贡献!
许可协议
本项目采用 MIT 许可协议。有关更多信息,请参阅LICENSE 文件。