已关闭。此问题为opinion-based。目前不接受回答。
**要改进此问题吗?**更新此问题,以便editing this post可以使用事实和引文来回答。
2天前关闭。
Improve this question的
我想要像下面这样的双休息:
[ your title there ]
some kind of content...
字符串
在rust中,有两个宏要打印到stdin,一个有like break,一个没有like break。下面是一些可能的代码打印like:
// use println! only for consistency.
println!("[ your title here ]\n"); // i find it awkward because prinln! already has some sort of '\n' in it.
println!("some kind of content...");
型
或
// use print! only for consistency.
// but still find it awkward because println! is usually used for single like break
// and this section of code may be the only place where print! is used to print single like break.
print!("[ your title here ]\n\n");
print!("some kind of content...\n");
型
有没有更好的方法在Rust中打印双行或多行换行符?或者其他语言,如C#,Java,.等,将不带like break的打印和带单个like break的打印作为单独的函数?
1条答案
按热度按时间utugiqy61#
怎么样
字符串
您的程式码与产生的输出具有相同的版面配置和分行符号数目,这让您一眼就能看出分行符号的位置。