Skip to content

Miscellaneous

wordTruncate()

wordTruncate() — returns any

Truncates text to the specified length of words and replaces the remaining characters with the specified truncate string (which defaults to ”…”).

NameTypeRequiredDefaultDescription
textstringyesThe text to truncate.
lengthnumericyes5Number of words to truncate the text to.
truncateStringstringyes...String to replace the last characters with.
#wordTruncate(text="Wheels is a framework for ColdFusion", length=4)#
-> CFWheels is a framework...

#truncate(text="Wheels is a framework for ColdFusion", truncateString=" (more)")#
-> CFWheels is a framework for (more)