Generates a new collection which contains the objects specified by expression.
collect(Block expression) | |||
---|---|---|---|
Argument | Block | expression | Expression that is applied to all objects in the collection. |
Return value | Collection | Collection with the results which arise by executing of the expression. The collection has the same type (e.g. list), as the collection, that collect is sent to. |
Formula | Result |
---|---|
=List{'abc','bc','c'}.collect(x|x.size) | [3, 2, 1] |