x[...z]
(lower span) operator
The lower span operator returns the elements of its left-hand Ranged
operand upto and including the element whose key is specified by its
right-hand operand.
Usage
String[] names = {"foo", "bar", "baz"};
String[] foo = names[...0];
String[] foobar = names[...1];
String[] emptySequence = names[...-1];
Description
Definition
The lhs[...rhs]
operator is defined as follows:
lhs.spanTo(rhs)
See the language specification for more details.
Polymorphism
The x[...z]
operator is polymorphic.
The meaning of x[...z]
depends on the
Ranged
interface.
Type
The result type of the lhs[..to]
operator is the element type of the Ranged
lhs
.
See also
-
x[y..z]
(span) operator used for obtaining a span of aRanged
. -
x[y...]
(upper span) operator used for obtaining a span of aRanged
. - API documentation for
Ranged
- sequence operators in the language specification
- operator precedence in the language specification
- Operator polymorphism in the Tour of Ceylon