TRIM Function

Removes leading and trailing white space.

Category: String
Returned data type: String

Syntax

TRIM(source)

Required Argument

source

a string from which the leading and trailing white space needs to be removed; this can be specified as string constant, s field name, or an expression.

Note If source is NULL, the function returns a NULL value. If source is an empty value (""), the function returns an empty value.

Example

source = " abcd " // 2 leading and 2 trailing spaces
result = trim(source) // outputs "abcd"
length = len(source) // outputs 8
length = len(result) // outputs 4