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

There's more...

This recipe is written with the assumption that you want to use stdin for live interaction over the cli. If you plan on instead piping some data into it (for example, cat foo.txt | stdin.rs on *nix), you can stop treating the iterator returned by lines() as infinite and retrieve the individual lines, not unlike how you retrieved the individual parameters in the last recipe.

There are various calls to trim() in our recipe [35, 45 and 55]. This method removes leading and trailing whitespace in order to enhance the user-friendliness of our program. We are going to look at it in detail in the Using a string section in Chapter 2, Working with Collections.

主站蜘蛛池模板: 将乐县| 卓尼县| 闽侯县| 永德县| 垣曲县| 馆陶县| 吴忠市| 莎车县| 邳州市| 河南省| 洛隆县| 呼伦贝尔市| 合水县| 岳西县| 阜阳市| 永胜县| 大埔区| 瓦房店市| 南平市| 墨脱县| 虞城县| 深圳市| 岗巴县| 株洲市| 和林格尔县| 册亨县| 许昌县| 汽车| 盈江县| 察哈| 永兴县| 台东县| 大石桥市| 通渭县| 伊金霍洛旗| 山东省| 剑川县| 弋阳县| 杨浦区| 鹿泉市| 杭锦后旗|