Merge pull request #15258 from eugenp/ulisseslima-patch-1
BAEL-2499 - Write to CSV in Java
This commit is contained in:
commit
4e4fa700ae
|
@ -12,6 +12,10 @@ public class WriteCsvFileExample {
|
|||
}
|
||||
|
||||
public String escapeSpecialCharacters(String data) {
|
||||
if (data == null) {
|
||||
throw new IllegalArgumentException("Input data cannot be null");
|
||||
}
|
||||
|
||||
String escapedData = data.replaceAll("\\R", " ");
|
||||
if (data.contains(",") || data.contains("\"") || data.contains("'")) {
|
||||
data = data.replace("\"", "\"\"");
|
||||
|
|
Loading…
Reference in New Issue