Wrap - MACROMEDIA COLDFUSION MX 61-CFML Reference

Cfml reference
Hide thumbs Also See for COLDFUSION MX 61-CFML:
Table of Contents

Advertisement

Wrap

Description
Wraps text so that each line has a specified maximum number of characters.
Returns
String containing the wrapped text.
Category
String functions
Function syntax
Wrap(string, limit[, strip])
See also
cfmail
History
ColdFusion MX 6.1: Added this function
Parameters
Parameter
string
limit
strip
Usage
Inserts line break at the location of the first white space character (such as a space, tab, or new
line) before the specified limit on a line. If a line has no whitespace characters before the limit,
inserts a line break at the limit. Uses the operating-system specific line break: newline for UNIX,
carriage return and newline on Windows.
If you specify the
formatting is lost.
Use this function to limit the length of text lines, such as text to be included in a mail message.
The
and
cfmail
Example
<h3>Wrap Example</h3>
<cfset inputText="This is an example of a text message that we want to wrap. It
is rather long and needs to be broken into shorter lines.">
<cfoutput>#Wrap(inputText, 59)#</cfoutput>
Description
String or variable that contains one. The text to wrap.
Positive integer maximum number of characters to allow on a line.
Boolean specifying whether to remove all existing newline and carriage return
characters in the input string with spaces before wrapping the text. Default: False.
parameter, all existing line breaks are removed, so any paragraph
strip
tag
cfmailpart
wraptext
attributes use this function
Wrap
737

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion mx

Table of Contents