TRIM Function /text/scalc/01/func_trim.xhp TRIM function

TRIM

Removes spaces from a string, leaving only a single space character between words.
TRIM("Text") Text refers to text in which spaces are to be removed. =TRIM(" hello world ") returns hello world without leading and trailing spaces and with single space between words.
TRIM wiki page.