truncate()
Description
Truncates text to the specified length and replaces the last characters with the specified truncate string (which defaults to "...").
Function Syntax
truncate(text [, length, truncateString ])
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
text |
string |
Yes | |
The text to truncate. |
length |
numeric |
No | 30 |
Length to truncate the text to. |
truncateString |
string |
No | ... |
String to replace the last characters with. |
Examples
#truncate(text="Wheels is a framework for ColdFusion", length=20)#
-> Wheels is a frame...
#truncate(text="Wheels is a framework for ColdFusion", truncateString=" (more)")#
-> Wheels is a framework f (more)
