in src/main/java/org/apache/commons/csv/CSVPrinter.java [194:222]
public synchronized void printComment(final String comment) throws IOException {
if (comment == null || !format.isCommentMarkerSet()) {
return;
}
if (!newRecord) {
println();
}
appendable.append(format.getCommentMarker().charValue());
appendable.append(SP);
for (int i = 0; i < comment.length(); i++) {
final char c = comment.charAt(i);
switch (c) {
case CR:
if (i + 1 < comment.length() && comment.charAt(i + 1) == LF) {
i++;
}
//$FALL-THROUGH$ break intentionally excluded.
case LF:
println();
appendable.append(format.getCommentMarker().charValue());
appendable.append(SP);
break;
default:
appendable.append(c);
break;
}
}
println();
}