How to print strings with line breaks in java

前端 未结 9 650
刺人心
刺人心 2020-12-01 17:10

I need to print a string using java so I fond the following solution After googled a lot. I have done some changes to print the string without showing the print dialog. My p

9条回答
  •  执笔经年
    2020-12-01 17:45

    Adding /r/n between the Strings solved the problem for me. give it a try. On pasting dont include the '//' for excluding.

    Eg: Option01\r\nOption02\r\nOption03

    this will give output as
    Option01
    Option02
    Option03

提交回复
热议问题