Description

Removes leading and trailing spaces and control characters from a string.

Returns

A copy of the string parameter, after removing leading and trailing spaces and control characters.

Category

String functions

Function syntax

Trim(string)

See also

LTrimRTrim

Parameters

Parameter

Description

string

A string or a variable that contains a string.

Example

<cfscript>
    string="    This is a typical      Hello World    string       "
    writeOutput(Trim(string))
</cfscript>

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy