How to remove the carriage return from string while pasting content to Excel file

后端 未结 5 1751
逝去的感伤
逝去的感伤 2020-12-11 03:17

I have a problem while pasting my contents (or text) generated by Java code into excel. The problem is that my Java code generates a String with multiple lines, i.e. with li

5条回答
  •  清歌不尽
    2020-12-11 03:52

    class Test {
        public static void main(String args[])
        System.out.print("Hello\rHi");
    }
    

    Due to \r cursor moves to starting of the current line, so "He" of Hello is replaced by "Hi".

提交回复
热议问题