TRIM

Returns a string where all whitespace characters (spaces, tabs, newlines, etc.) have been removed from both the start and end of the specified string.

Syntax

=TRIM(string)

Arguments

ArgumentTypeDescription
stringStringThe string to trim whitespace characters from

Examples

=TRIM("ABC ")"ABC"
Removes the trailing whitespace characters from the string

=TRIM(" DEF")"DEF"
Removes the leading whitespace characters from the string

=TRIM(" GHI ")"GHI"
Removes leading and trailing whitespace characters from the string

=TRIM("Hello World")"Hello World"
As there are no whitespace characters at the beginning or end of the string, the string is returned unchanged.