Strings

These documentation pages are no longer maintained. Please visit the new documentation site.

The following table contains a list of template operators related to strings and string handling. Click on the name of an operator for more information about that specific operator (usage, parameters, description, examplets, etc.).

Operator Description
mimetype_iconConverts a MIME-Type string into an icon.
appendAppends element(s) to a string.
begins_withChecks if a string starts with a specific element/sequence.
breakInserts HTML line breaks instead of newlines.
ordReturns a desired sequence of characters.
compareCompares the contents of two strings.
concatConcatenates values to one string.
containsChecks if a string contains a specific element.
count_charsCounts and returns the number of characters (string length).
count_wordsCounts and returns the number of words within a string.
crc32Calculates the CRC32 polynomial of a string.
downcaseConverts all alphabetical characters to lowercase.
ends_withChecks if a string ends with a specific element/sequence.
explodeSplits a string into an array of substrings.
extractExtracts a portion from a string.
extract leftExtracts a portion from the start of a string.
extract_rightExtracts a portion from the end of a string.
indentIndents a string by inserting characters at the start of it.
insertInserts stuff at specified position in a string.
md5Calculate the md5 hash of a string.
nl2brConverts newlines to HTML br.
chrCreates a string based on array of ASCII/Unicode values.
padMakes sure a string is at least n characters long.
prependPrepends custom sequence to a string.
removeRemoves element(s) from a string.
repeatRepeats the contents of a string.
reverseReverses the contents of a string.
rot13Performs a rot13 transform on a string.
shortenShortens a string to a few characters + adds trailing seq.
simplifyTransforms multiple consecutive characters into one.
trimStrips whitespace from beginning and/or end of a string.
upcaseConverts all alphabetical characters to uppercase.
upfirstConverts the first character to uppercase.
upwordConverts all the first characters (in all words) to uppercase.
washGeneral text wash. Translates bogus strings to friendly ones.
wordtoimageReplaces special sequences of text with images.
wrapWraps text to lines at a specified length.

Comments

see new contrib: str_replace

A simple replace function?

Are there any simple string replace function. Something like PHP's "str_replace"?

Contents

Reference

Database diagram
Template operators
    PDF
    Arrays
    Data extraction
    Formatting
    Images
    Logic
    Mathematics
    Miscellaneous
    Strings
       mimetype_icon
       append
       begins_with
       break
       ord
       compare
       concat
       contains
       count_chars
       count_words
       crc32
       downcase
       ends_with
       explode
       extract
       extract left
       extract_right
       indent
       insert
       md5
       nl2br
       chr
       pad
       prepend
       remove
       repeat
       reverse
       rot13
       shorten
       simplify
       trim
       upcase
       upfirst
       upword
       wash
       wordtoimage
       wrap
    URLs
    Variables
Template functions
Data fetching
Modules
XML tags


Created

05/02/2004
10:19:03 am
by Balazs Halasy

Last updated

05/02/2004
3:59:31 pm
by Balazs Halasy

Authors

Balazs Halasy



This page is part of the eZ Publish documentation. The documentation is available under the GNU Free Documentation License. All contributions will be released under the terms of this license.