Back to blog
documentation

Take

Take is the operation that limits a sequence to the passed number of elements.

Syntax

Take
  : 'take' '(' ConstantExpression ')'  
  ;

Related tokens

[ConstantExpression](../expression/constant)

Take examples

Returns only 3 cells from the sequence.

select(tableCells) // PdfTableCell[]
    ->take(3) // PdfTableCell[]