티스토리 뷰

공부

[Java] remove line break `(\n|\r|\u0001)`

seunggabi 승가비 2021. 1. 8. 23:33
728x90
private static Column fixText(Column column) {
    return regexp_replace(
            regexp_replace(
                    regexp_replace(
                            column, "\\n", ""),
                    "\\r", ""),
            "\\u0001", "");
}


text
    .replace("\\n", "")
    .replace("\\r", "")
    .replace("\\u0001", "")

https://stackoverflow.com/questions/2163045/how-to-remove-line-breaks-from-a-file-in-java

 

How to remove line breaks from a file in Java?

How can I replace all line breaks from a string in Java in such a way that will work on Windows and Linux (ie no OS specific problems of carriage return/line feed/new line etc.)? I've tried (note

stackoverflow.com

 

728x90

'공부' 카테고리의 다른 글

[Pyspark] show all results  (0) 2021.01.08
[Regexp] ignore case sensitivity  (0) 2021.01.08
[Java] remove line break `(\n|\r|\u0001)`  (0) 2021.01.08
[Spark][SQL] GET_JSON_OBJECT  (0) 2021.01.08
[zeppelin] pyspark is not responding  (0) 2021.01.06
[JS] html onLoad not working  (0) 2021.01.04
댓글
댓글쓰기 폼