Package
Conforms to
Initializers
Methods
Value Type β©
Range, an immutable sequence of numbers. Read more in the language reference.
Initializers
π
π π start π’ stop π’
Creates a range from start to stop.
π
π π start π’ stop π’ step π’
Creates a range from start to stop with the provided step.
Methods
π½βοΈ
βοΈ π½ n π’ β‘οΈ π’
Returns the n*th element of the range. *n is only valid if start + step * n
is >= start
and < stop
. If n is invalid, the program will panic.
πβ
β π β‘οΈ π’
Returns the number of integers in this range.
π‘βοΈ
βοΈ π‘ β‘οΈ π³ππ’π
Returns an iterator to iterate over integers in this range.