Bug 113903 - Trim() function doesn't trim spaces
Summary: Trim() function doesn't trim spaces
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.3.1.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-17 12:36 UTC by John Russell
Modified: 2017-11-17 13:25 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Russell 2017-11-17 12:36:16 UTC
Description:
Trim(string_with_spaces) = string_with_spaces so the function does nothing

Steps to Reproduce:
1.Enter trim function in a cell: =trim("a b c")
2.
3.

Actual Results:  
"a b c"

Expected Results:
"abc"


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 5.3.1.2
Build ID: 1:5.3.1-0ubuntu2


User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.89 Safari/537.36 OPR/49.0.2725.39
Comment 1 Xisco Faulí 2017-11-17 13:21:07 UTC
Trim function removes the spaces and tabs from the beginning and end of the string, but not from the middle. If you want to remove the spaces in between, you need to use =SUBSTITUTE("a b c"; " "; "" )
Closing as RESOLVED NOTABUG
Comment 2 Mike Kaganski 2017-11-17 13:25:13 UTC
Trim (https://help.libreoffice.org/Calc/Text_Functions#TRIM) trims leading and trailing spaces, and folds multiple adjacent spaces into single spaces, like this:

=TRIM(" a   b      c ") -> "a b c"

It works like that in 5.3.1.2, as well as in 5.4.3.2 => NOTABUG