extract

Summary

Returns a portion of the input string.

Usage

input|extract( offset [, length] )
 

Parameters

NameTypeDescriptionRequired
offset integer The offset to start at. Yes.
length integer The number of characters that should be extracted. No.

Returns

A string containing a portion of the input string.

Description

This operator will return a portion of the input string. The returned portion must be defined by the "offset" and "length" parameters. If the "length" parameter is omitted, the rest of the string (from offset) will be returned.

Examples

Example 1

{'I love monday mornings!'|extract( 7 )}

The following output will be produced: "monday mornings!".

Example 2

{'Big apples.'|extract( 4, 5 )}

The following output will be produced: "apple".

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