Skip to content

Trim

See Also: String Functions, String Operators (Expression Syntax), Ltrim, Rtrim

Purpose

Trim returns a string with leading and trailing white space characters removed.

White space characters removed include: - ASCII character 0 (null) - ASCII character 9 (horizontal tab) - ASCII character 10 (line feed) - ASCII character 11 (vertical tab) - ASCII character 12 (new page/form feed) - ASCII character 13 (carriage return) - ASCII character 32 (space)

Return Type

String

Syntax

(Trim({string-value}))

What It Does

Trim removes all white space characters to the left of the leftmost non-space and to the right of the rightmost non-space character in the {string-value} parameter.

Showln "$" (Trim("   Happyness   ")) "$"

In this example, the string "$Happyness$" is shown.

Notes

This function returns a value of type string. If the result of this function is moved to a variable of a type other than string, its value is converted to the destination type, if possible.