[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jakarta-commons-dev
Subject:    [jira] [Comment Edited] (CSV-148) CSVFormat.ignoreSurroundingSpaces is ignored when printing
From:       "Ravi Teja (JIRA)" <jira () apache ! org>
Date:       2016-05-31 14:27:12
Message-ID: JIRA.12768427.1421668631000.337597.1464704832930 () Atlassian ! JIRA
[Download RAW message or body]


    [ https://issues.apache.org/jira/browse/CSV-148?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15307795#comment-15307795 \
] 

Ravi Teja edited comment on CSV-148 at 5/31/16 2:26 PM:
--------------------------------------------------------

[~pratiyush], [~garydgregory] Isn't this the same as withTrim(true) ?


was (Author: bond_):
[~pratiyush] [~garydgregory] Isn't this the same as withTrim(true) ?

> CSVFormat.ignoreSurroundingSpaces is ignored when printing
> ----------------------------------------------------------
> 
> Key: CSV-148
> URL: https://issues.apache.org/jira/browse/CSV-148
> Project: Commons CSV
> Issue Type: Bug
> Components: Printer
> Affects Versions: 1.1
> Environment: JDK 1.7
> Reporter: Piotr Ciruk
> Priority: Minor
> Fix For: Review
> 
> Attachments: commons-csv_CSV-148.patch, commons-csv_CSV-148.patch
> 
> 
> It seems that {{CSVFormat}}'s property {{ignoreSurroundingSpaces}} is not taken \
> into consideration while printing out values using {{CSVPrinter}}. Given:
> {code}
> System.out.println(
> 	CSVFormat.DEFAULT
> 			.withIgnoreSurroundingSpaces(true)
> 			.format("",
> 				" ",
> 				" Single space on the left",
> 				"Single space on the right ",
> 				" Single spaces on both sides ",
> 				"   Multiple spaces on the left",
> 				"Multiple spaces on the right    ",
> 				"  Multiple spaces on both sides     ")
> );
> {code}
> Actual result:
> {code}
> ""," "," Single space on the left","Single space on the right "," Single spaces on \
> both sides ","   Multiple spaces on the left","Multiple spaces on the right    ","  \
> Multiple spaces on both sides     " {code}
> Expected result:
> {code}
> "","","Single space on the left","Single space on the right","Single spaces on both \
> sides","Multiple spaces on the left","Multiple spaces on the right","Multiple \
> spaces on both sides" {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic