Bug 65230 - TRIM function: implementation incomplete
Summary: TRIM function: implementation incomplete
Alias: None
Product: POI
Classification: Unclassified
Component: SS Common (show other bugs)
Version: 5.0.0-FINAL
Hardware: All All
: P2 minor (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2021-04-09 08:56 UTC by gerard.duong
Modified: 2021-07-28 13:19 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description gerard.duong 2021-04-09 08:56:29 UTC
The current implementation of the TRIM function just "String.trim()" the input. This is not enough.

Indeed, a quick test within Excel of Office 365, shows that this function also reduces duplicated spaces between words to simple ones.
So this behavior should be replicated within the TextFunction class.

Test case:
Just add the following line in TestTrim.testBasic():
confirmTrim(new StringEval("hi  there"), "hi there");

This bug applies to the 4.1.2-FINAL version too.

On a sidenote, the online documentation does not mention this specific behavior:
I have sent them a feedback on this matter.
The inline documentation is fortunately correct, at least the French one.
Comment 1 PJ Fanning 2021-07-28 13:18:46 UTC
change made in r1891851
Comment 2 PJ Fanning 2021-07-28 13:19:08 UTC
change made in r1891851