用write!
和writeln!
即可。
write!(&mut writer, "Factorial of {} = {}", num, factorial);
writeln!
就是在最后自动加一个换行。
原文:https://stackoverflow.com/questions/32472495/how-do-i-write-a-formatted-string-to-a-file
用write!
和writeln!
即可。
writeln!
就是在最后自动加一个换行。
原文:https://stackoverflow.com/questions/32472495/how-do-i-write-a-formatted-string-to-a-file
Except as otherwise noted, this blog is licensed under CC BY-SA 4.0 License.
©2021-
searchstar
|
pv
|
uv
Theme Tree
by Wu Jun
Powered by Hexo