Skip to content

Miscellaneous

truncate()

truncate() — returns any

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

NameTypeRequiredDefaultDescription
textstringyes—The text to truncate.
lengthnumericyes30Length to truncate the text to.
truncateStringstringyes...String to replace the last characters with.
#truncate(text="Wheels is a framework for ColdFusion", length=20)#
-> CFWheels is a frame...

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