I saw a question on the CF-Talk list asking about the new wrap() function in CF MX 6.1. It's not as intuitive a function as you would think. The first time I saw it, I assumed you passed it a string and a character break, and it would return a string formatted with tags at the appropriate interval. This is not what it does. Here's an explanation from my new book, Programming ColdFusion MX:
Usage: 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.
#wrap(myString, 80, False)#
If you need a function that actually inserts tags for you, consider wrap() from the CFLib.org web site. Note that you'll have to rename the UDF to avoid conflicting with the new wrap() function in 6.1.
CFLib.org
Raymond Camden's Blog
Christian Cantrell's Blog
Sean Corfield's Blog
Nathan Dintenfass' Blog
Todd Rafferty's Blog
Steve Rittler's Blog
Cameron Childress's Blog