We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 57c7734 commit d378f3eCopy full SHA for d378f3e
1 file changed
src/main/java/org/apache/commons/csv/CSVFormat.java
@@ -894,7 +894,9 @@ public String format(final Object... values) {
894
final StringWriter out = new StringWriter();
895
try (CSVPrinter csvPrinter = new CSVPrinter(out, this)) {
896
csvPrinter.printRecord(values);
897
- return out.toString().trim();
+ String res = out.toString();
898
+ int len = recordSeparator != null ? res.length() - recordSeparator.length() : res.length();
899
+ return res.substring(0, len);
900
} catch (final IOException e) {
901
// should not happen because a StringWriter does not do IO.
902
throw new IllegalStateException(e);
0 commit comments