The elementAt function

This function returns an element at a specified index:

val myRange = 1..10
println("Element at index 1 =" + myRange.elementAt(1))

The myRange index starts from 0, so elementAt(0) will return 1 and elementAt(1) will return 2.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.58.51.228