trim

Removes leading and trailing spaces from a string.

trim(String) → returns string

Argument Reference

String string
Required

A string or a variable that contains one

Examples
Sample code invoking the trim function

'>' & trim('    CFDocs    ') & '<'

Expected Result: >CFDocs<

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

Fork me on GitHub