insert

Summary

Returns the input string with additional text inserted at a specified position.

Usage

input|insert( offset, sequence )

Parameters

NameTypeDescriptionRequired
offset integer The position where the sequence should be inserted. Yes.
sequence string The string that should be inserted. Yes.

Returns

A string consisting of the input and the inserted sequence.

Description

This operator inserts a sequence of characters at a specified position of the input string. The resulting string will be returned.

Examples

Example 1

{'My string is simple.'|insert( 3, 'static ' )}

The following output will be produced: "My static string is simple.".

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