How do I use System.getProperty(“line.separator”).toString()?

前端 未结 7 1133
Happy的楠姐
Happy的楠姐 2020-12-29 05:41

I have a Tab-delimited String (representing a table) that is passed to my method. When I print it to the command line, it appears like a table with rows:

http://i.st

7条回答
  •  抹茶落季
    2020-12-29 06:00

    Try

    rows = tabDelimitedTable.split("[" + newLine + "]");
    

    This should solve the regex problem.

    Also not that important but return type of

    System.getProperty("line.separator")
    

    is String so no need to call toString().

提交回复
热议问题