TRIM

Trims the leading and trailing spaces from the string passed to the function.

Syntax

= TRIM(str)

Parameters

str

A string whose spaces have to be trimmed. Its value can be specified as a decimal value (e.g., 37.48), as a string (“Word”), or as the value of a variable (e.g, FirstName).

Return Type

String

In the case of an error, the function displays an error message: “TRIM(str): Error message”

The function can be used in combination with other functions.

Examples

Example

Returns

= TRIM(“            Iron Speed Designer                   “)

“Iron Speed Designer”

= TRIM(Product )

The value of Product without leading or trailing spaces.

= TRIM(RIGHT(“Iron Speed Designer”, 9))

A trimmed version of the extracted string.

= TRIM(“   Iron”, SUBSTRING(“Iron Speed Designer”, 6, 5))

A trimmed version of the extracted string concatenated with the passed string.