Note: information on this page refers to Ceylon 1.0, not to the current release.

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