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

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.

主站蜘蛛池模板: 武义县| 雅安市| 武夷山市| 缙云县| 连江县| 保康县| 晋宁县| 广丰县| 布尔津县| 许昌市| 麻栗坡县| 临安市| 南宁市| 英吉沙县| 浮梁县| 阳信县| 陕西省| 卓尼县| 广宗县| 桐柏县| 永州市| 宜丰县| 龙州县| 双流县| 南丹县| 南充市| 汉源县| 芦山县| 古丈县| 河源市| 六盘水市| 剑阁县| 化州市| 东方市| 晋江市| 海兴县| 洪湖市| 临猗县| 崇礼县| 佛山市| 鄂托克旗|