wrap

Summary

Wraps text to lines at a specified length.

Usage

$string|wrap([width [, break_sequence [, cut]]])
 

Parameters

NameTypeDescriptionRequired
width integer Desired width. no
break_sequence string Custom break sequence. no
cut boolean Force wrap. no

Returns

wrapped version of input string.

Description

By inserting newline ('\n') characters into the inputted string, this operator wraps a given text at a specified position. If the width parameter is omitted, it will automatically wrap at 80. The break_sequence parameter specifies a string containing the desired break sequence to use, default is '\n' (newline). The cut parameter specifies if the string should always be wrapped at the specified width or not. In other words: if you have a word that is larger than the given width, it will be broken apart.

Examples

{"Hello world"|wrap(5)}

returns the string
"Hello
world"

Comments

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
12:02:42 pm
by Balazs Halasy

Last updated

10/02/2004
11:34:16 am
by Balazs Halasy

Authors

Balazs Halasy



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