Caution: This documentation is for eZ Publish legacy, from version 3.x to 6.x.
For 5.x documentation covering Platform see eZ Documentation Center, for difference between legacy and Platform see 5.x Architecture overview.

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".

Balazs Halasy (05/02/2004 10:56 am)

Svitlana Shatokhina (17/04/2006 2:08 pm)


Comments

There are no comments.