trim

Summary

Returns a stripped version of the input string.

Usage

input|trim( [char_list] )

Parameters

NameTypeDescriptionRequired
char_list string Characters that should be removed. No.

Returns

A stripped version of the input string.

Description

This operator removes characters from the beginning and the end of the input string. By default, it will get rid of the following characters:

Character

ASCII value (dec)

ASCII value (hex)

Description

 

32

0x20

An ordinary space.

\t

9

0x09

A tab.

\n

10

0x0A

A new line (line feed).

\r

13

0x0D

A carriage return.

\0

0

0x00

The NUL-byte.

\x0B

11

0x0B

A vertical tab.

Examples

Example 1

{'    Gizmo is not a gremlin.  '|trim()}

The following output will be produced: "Gizmo is not a gremlin."

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