Revision 60199
Added by Michele Artini about 3 years ago
CsvConverter.java | ||
---|---|---|
40 | 40 |
} |
41 | 41 |
|
42 | 42 |
private static String prepareValue(final String s) { |
43 |
return s.replaceAll("\\n", " ") |
|
44 |
.replaceAll("\\t", " ") |
|
45 |
.replaceAll("\\s+", " ") |
|
46 |
.replaceAll("\\p{C}", "?") // Unprintable chars |
|
47 |
.trim(); |
|
43 |
return s == null ? "" |
|
44 |
: s.replaceAll("\\n", " ") |
|
45 |
.replaceAll("\\t", " ") |
|
46 |
.replaceAll("\\s+", " ") |
|
47 |
.replaceAll("\\p{C}", "?") // Unprintable chars |
|
48 |
.trim(); |
|
48 | 49 |
} |
49 | 50 |
} |
Also available in: Unified diff
fixed NPE