TheDocumentation Index
Fetch the complete documentation index at: https://docs.syntblaze.com/llms.txt
Use this file to discover all available pages before exploring further.
.. (range) operator constructs a System.Range struct that represents a contiguous sub-segment of a collection. It serves as syntactic sugar for defining boundaries, utilizing System.Index types to specify an inclusive lower bound and an exclusive upper bound.
Syntax and Operands
The operator accepts two optional operands. Because both operands are optional, the operator supports four distinct syntax variations:- Left operand: The inclusive start index. If omitted, it defaults to
0(the beginning of the collection). - Right operand: The exclusive end index. If omitted, it defaults to
^0(the end of the collection).
Type Resolution and Compilation
Operands supplied to the.. operator must evaluate to type int or System.Index. When standard integers are provided, the compiler implicitly converts them to System.Index structs.
During compilation, the .. syntax is lowered directly into an instantiation of the System.Range struct via its constructor.
Operator Characteristics
- Associativity: The
..operator is non-associative. Chaining the operator (e.g.,a..b..c) is syntactically invalid and produces a compiler error. - Precedence: It evaluates with lower precedence than arithmetic operators (like
+or*) but higher precedence than relational and equality operators (like<or==). - Immutability: The
System.Rangestruct generated by the operator is areadonly struct. ItsStartandEndproperties cannot be mutated after initialization.
Master C# with Deep Grasping Methodology!Learn More





