- 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.
推薦閱讀
- Oracle從入門到精通(第3版)
- Cocos2d Cross-Platform Game Development Cookbook(Second Edition)
- CMDB分步構建指南
- HTML5+CSS3基礎開發教程(第2版)
- 基于免疫進化的算法及應用研究
- 薛定宇教授大講堂(卷Ⅳ):MATLAB最優化計算
- 高級C/C++編譯技術(典藏版)
- Monitoring Elasticsearch
- Mastering AndEngine Game Development
- R Deep Learning Cookbook
- HTML5+CSS3 Web前端開發技術(第2版)
- Java程序員面試筆試寶典(第2版)
- 代替VBA!用Python輕松實現Excel編程
- Unity 2018 Augmented Reality Projects
- Managing Microsoft Hybrid Clouds