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

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.

主站蜘蛛池模板: 那坡县| 灵川县| 平舆县| 仲巴县| 得荣县| 衡南县| 新沂市| 承德县| 新源县| 全州县| 霍林郭勒市| 土默特右旗| 绵阳市| 郎溪县| 莎车县| 张家界市| 西平县| 二连浩特市| 兴义市| 抚顺县| 龙州县| 新河县| 安丘市| 峨边| 长沙县| 安西县| 临西县| 宝丰县| 剑河县| 漾濞| 鹿泉市| 洞头县| 宜川县| 邢台县| 皮山县| 民乐县| 县级市| 炉霍县| 揭阳市| 邓州市| 卢湾区|