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

Traversing through ranges using progression with a custom step value

Besides doing so for the Iterator instances, progressions implementations for integral types, such as the Int, Long, and Char types, also include the step property. The step value specifies the intervals between the subsequent elements of a range. By default, the step value of a progression is equal to 1. In this recipe, we are going to learn how to traverse a range of alphabet characters with a step value equal to 2. In the result, we want to have every second alphabet letter printed to the console.

主站蜘蛛池模板: 平定县| 丰顺县| 抚州市| 双辽市| 湄潭县| 伊吾县| 吉林省| 南投县| 车致| 防城港市| 双峰县| 宝坻区| 依安县| 泽普县| 家居| 花垣县| 绥棱县| 板桥市| 鸡东县| 长武县| 綦江县| 囊谦县| 肇庆市| 固阳县| 凉山| 卓尼县| 会理县| 山东省| 平邑县| 卫辉市| 施甸县| 临洮县| 安吉县| 鲜城| 滦南县| 巴林右旗| 新巴尔虎右旗| 筠连县| 巫山县| 郯城县| 托克托县|