Wrap()
Wraps text so that each line has a specified maximum number of characters.
Wrap( string=string, limit=number, strip=boolean );
Returns: String
| Argument | Description |
|---|---|
|
string
string,
required
|
edit
The text to wrap. |
|
limit
number,
required
|
edit
Positive integer maximum number of characters to allow on a line. |
|
strip
boolean,
optional
|
edit
Whether to remove all existing newline and carriage return characters in the input string with spaces before wrapping the text. |
Examples
editlong_string = "A light-weight dynamic scripting language for the JVM that enables the rapid development of simple to highly sophisticated web applications.";
echo( "<pre>" & wrap( long_string, 20 ) & "</pre>" );
See also
- Strings
- string.wrap()
- Search Issue Tracker open_in_new
- Search Lucee Test Cases open_in_new (good for further, detailed examples)