- Learning Rust
- Paul Johnson Vesa Kaihlavirta
- 81字
- 2021-07-02 23:07:21
Controlling the output formatting
The std::fmt module provides the developer with a range of utilities for formatting and printing strings. Let's start with the format! macro. This macro returns a string.
We have seen that if we use println!(Hello {}, myString), the code will print the contents of myString after the Hello. The format! macro works pretty much the same, just that it returns the formatted string instead of outputting it. In fact, println! essentially uses format! itself under the hood.
推薦閱讀
- Dynamics 365 for Finance and Operations Development Cookbook(Fourth Edition)
- Apache Spark 2.x Machine Learning Cookbook
- Working with Odoo
- ANSYS Fluent 二次開發指南
- C++新經典
- Java程序設計入門
- SQL Server 2008中文版項目教程(第3版)
- Java 9 with JShell
- Hands-On Dependency Injection in Go
- Instant AppFog
- 計算機軟件項目實訓指導
- 多接入邊緣計算實戰
- Python數據分析與挖掘實戰(第2版)
- JSP編程教程
- Expert Angular