- 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.
推薦閱讀
- Learn ECMAScript(Second Edition)
- Manga Studio Ex 5 Cookbook
- Java EE 7 Performance Tuning and Optimization
- ANSYS Fluent 二次開發(fā)指南
- Swift語言實戰(zhàn)精講
- Java程序設(shè)計入門
- Python機器學(xué)習:預(yù)測分析核心算法
- “笨辦法”學(xué)C語言
- 3ds Max 2018從入門到精通
- Spring Boot從入門到實戰(zhàn)
- Google Maps JavaScript API Cookbook
- Kotlin入門與實戰(zhàn)
- Scratch 3.0少兒積木式編程(6~10歲)
- Oracle API Management 12c Implementation
- Responsive Web Design with HTML5 and CSS3(Second Edition)