- Kotlin Standard Library Cookbook
- Samuel Urbanowicz
- 123字
- 2021-07-23 19:05:48
How it works...
In the result, we are going to get the following code printed to the console:
zxvtrpnljhfdb
In the beginning, we declared a range containing all the alphabet characters in decreasing order with the downTo() function. Then, we transformed the range a the custom progression containing every second character with the step() function. Finally, we are using the Iterable.forEach() function to iterate through the next elements of the progression and print each of them to the console.
The step() extension function is available for the IntProgression, LongProgression, and CharProgression types. Under the hood, it creates a new instance of a progression copying the properties of the original one and setting up the new step value.
推薦閱讀
- Mastering OpenLayers 3
- JavaScript+DHTML語法與范例詳解詞典
- Android項目開發入門教程
- Learning RxJava
- 算法基礎:打開程序設計之門
- Learning ArcGIS Pro
- Python Data Analysis(Second Edition)
- 零基礎學Python網絡爬蟲案例實戰全流程詳解(高級進階篇)
- Mastering Ext JS
- Visual FoxPro程序設計
- Learning Raspbian
- Getting Started with LLVM Core Libraries
- ActionScript 3.0從入門到精通(視頻實戰版)
- ASP.NET求職寶典
- Android智能手機APP界面設計實戰教程