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.