TRIM function
Text
The text string to trim.
Returns
The resulting text string.
Removes any excess whitespace characters (such as space characters) from a text string and returns the modified text string. TRIM(" abc def ")TRIM(" abc def ") returns "abc def".
All leading and trailing whitespace characters are removed, and all occurrences of multiple whitespace characters joined together are replaced with single space characters.
The spreadsheet versions of TRIM typically only remove space characters, not all whitespace characters. An example of a whitespace character which is not a space character is the non-breaking space character, which prevents line breaking from taking place, and is often found in HTML documents.
Examples
Returns "abc def".
Returns "abc def". REPT(CHAR(160), 10)REPT(CHAR(160); 10) returns ten non-breaking space characters, which TRIM also removes.
Returns the array { "abc def", "1 2 3" }{ "abc def"; "1 2 3" }.