remove

Summary

Returns the input array without some of the original elements.

Usage

input|remove( offset [, length ] )

Parameters

NameTypeDescriptionRequired
offset integer The offset to start removing elements. Yes.
length integer The number of elements that should be removed. No.

Returns

A cut-down version of the input array.

Description

This operator removes element(s) from the input array and thus a chopped/cut-down version of the input array will be returned. The "offset" parameter must be used to define the start of the portion that should be removed. The "length" parameter can be used to define the number of elements that should be removed. If the "length" parameter is omitted, only one elemen (specified by offset will be removed).

Examples

Example 1

{array( 1, 2, 3, 4, 5 )|remove( 2, 2 )}

The following array will be returned: ( 1, 2, 5 ).

Example 2

{array( 1, 2, 3, 4, 5 )|remove( 2 )}

The following array will be returned: ( 1, 2, 4, 5 ).

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2013 eZ Systems AS (except where otherwise noted). All rights reserved.