官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 沾益县| 上栗县| 武功县| 库尔勒市| 武山县| 水城县| 全州县| 锡林浩特市| 新丰县| 辽源市| 六枝特区| 荣成市| 西安市| 万安县| 旬邑县| 南康市| 汉中市| 苏尼特右旗| 得荣县| 宝坻区| 临朐县| 乐平市| 渭源县| 乌海市| 上饶县| 米易县| 申扎县| 油尖旺区| 叙永县| 炎陵县| 吉首市| 全州县| 安阳县| 揭东县| 九龙城区| 泽普县| 许昌市| 栖霞市| 凉城县| 策勒县| 潼南县|