input|simplify( [char] )
Name | Type | Description | Required |
---|---|---|---|
char | character | The character that should be simplified. | No. |
This operator takes a string as the input parameter. It transforms multiple consecutive characters into one. The operator can be used to remove the duplicates as it leaves only a single copy of each character. It is possible to specify only one character that should be simplified, this can be done using the optional "char" parameter. By default, the operator removes multiple spaces. Special characters must be specified using regular expression style, please refer to the table below.
Character | Description |
---|---|
\t |
Tab (HT, TAB) |
\n |
Newline (LF, NL) |
\r |
Return (CR) |
\f |
Form feed (FF) |
\a |
Alarm / bell (BEL) |
\e |
Escape / think troff (ESC) |
{'We don't need no whitespaces!'|simplify()}
The following output will be produced: "We don't need no whitespaces!".
{'This____string__is___annoying.'|simplify( '_' )}
The following output will be produced: "This_string_is_annoying.".
Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2013 eZ Systems AS (except where otherwise noted). All rights reserved.