Get the element type of the range.
First element of the range.
Check if the range is empty.
Last element of the range.
Number of elements in the range.
Step size of the range. For UnitRange, this returns 1.
Convert the range to an array. Note: This allocates memory for all elements.
Array of values.
Iterate over the range elements.
Check if the range contains a value.
Value to check.
true if the range contains the value.
Get element at the given index (0-based).
The index (0-based).
The element at the given index.
Map a function over the range.
Julia function to apply.
Result of mapping (typically a collected array).
StaticfromCreate a range from start to stop with optional step.
Start value (inclusive).
Stop value (inclusive for UnitRange, may not be included for StepRange).
Optionalstep: number | bigintOptional step value. If omitted, creates a UnitRange with step=1.
A new JuliaRange.
StaticlinspaceCreate a linearly spaced range (LinRange).
Start value.
Stop value.
Number of elements.
A new JuliaRange (LinRange type).
StaticwithCreate a range with specified length using Base.range().
Start value.
Number of elements.
Step value.
A new JuliaRange.
Wrapper for Julia Range types (UnitRange, StepRange, StepRangeLen, LinRange).
Julia ranges are lazy sequences that don't allocate memory for all elements. They only store start, stop, and step (if applicable).
Supported Range Types
UnitRange{T}- step is 1, e.g.,1:10StepRange{T,S}- with explicit step, e.g.,1:2:10StepRangeLen{T,R,S}- floating point ranges, e.g.,range(0, 1, length=11)LinRange{T}- linearly spaced, e.g.,LinRange(0, 1, 11)Example
Example