trimWhitespace

Collapses each run of whitespace in a string to a single whitespace character.

trimWhitespace(input) → returns string

This function requires Lucee.  Not supported on Adobe ColdFusion, etc.

Argument Reference

input string
Required

The string to clean up.

Examples
Sample code invoking the trimWhitespace function

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub