Development · Native API migration preview · Coverage validation in progress Published release →

API Browser

Struct

Range

struct Range

Module: System
Assembly: System.Runtime.dll
Source file: Range.rvn

Inheritance: Object → ValueType → Range
Implements: EquatableTo<Range>

A half-open range: the start boundary is inclusive and the end is exclusive.

Constructors

1 item
Range(start: Index, end: Index) Creates a range; bounds are validated when applied to a length.

Properties

3 items
Static member: All: Range A range covering the entire value, including an empty value.
End: Index The exclusive end boundary.
Start: Index The inclusive start boundary.

Methods

9 items
Static member: EndAt(end: Index) -> Range Creates a range from the first boundary through end, exclusively.
Equals(other: Range) -> bool Compares the two boundary indexes, independently of a collection length. Implements EquatableTo<Range>.Equals
Equals(other: object?) -> bool Compares a boxed value using the same distance and direction semantics. Overrides Object.Equals
GetHashCode() -> int Returns a hash consistent with typed equality. Overrides Object.GetHashCode
GetOffsetAndLength(length: int) -> (int, int) Resolves a validated offset and count; negative lengths, reversed or out-of-bounds ranges fault with IndexOutOfRange.
GetType() -> TypeInfo Returns metadata for the concrete runtime type of this instance. Inherited from Object.GetType
Static member: StartAt(start: Index) -> Range Creates a range from start through the end boundary.
ToString() -> string Formats the two boundaries separated by .. . Overrides Object.ToString
TryGetOffsetAndLength(length: int) -> Result<(int, int), InvalidRangeError> Resolves offset and count, returning InvalidRangeError for invalid bounds or a negative length.