Name
Wrap
Synopsis
Wrap(string, limit [,strip])Specifies the maximum number of characters to allow per line in
string. If a line is longer than the
specified number of characters, an attempt is made to break the line
by inserting a line break at the nearest whitespace character (space,
tab, etc) before the character limit. If
string contains no whitespace characters
before the maximum number of characters per line, a line break is
inserted at the maximum line length. Wrap() uses
operating system specific line breaks. On Windows,
it’s a carriage return and newline character. On
Unix/Linux, it’s a newline. Optionally, you can
specify a third Boolean argument to indicate whether to remove all
existing carriage line breaks before wrapping the string. The default
for this argument is false.
<cfset myString="This is a string that is so long, I probably would like to break it up. What do you think about that? Is it a good idea?"> <cfoutput> <pre>#Wrap(myString, 80, False)#</pre> </cfoutput>