Skip to the content
Documentation

extract

No ratings yet

Summary

Returns a portion of the input string.

Usage

input|extract( offset [, length] )

Parameters

Name Type Description Required
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".

Contributors

Comments

Add a comment

Comments are read by a moderator before they appear.