🚀 Welcome to MDriven Learn –  MDriven is now on Discord!  Don’t miss the latest Release Notes.
OCLOperators at0
Created by Alexandra on 2017-08-13 · Last edited by Colline.ssali on 2025-12-12.

at0 ( index : Integer ) : T

Returns the element of self at the *index* position.

Note! 0-based index.

Expression Result
Sequence{'a', 'b'}->at0(1) b

It returns the element in the collection using zero-based indexing. This means at0(0) returns the first element, at0(1) returns the second, and so on. It is especially useful when working with Sequences or when converting your instance collections into sequences using asSequence() or similar operators.

Example:

Department.allInstances->at0(0)

Results

Documentation OCLOperators at0 1765443836934.png


See also at operator and comments on indexof operators