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

前端 未结 7 1118
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:09

    The other responders are correct that split() takes a regex as the argument, so you'll have to fix that first. The other problem is that you're assuming that the line break characters are the same as the system default. Depending on where the data is coming from, and where the program is running, this assumption may not be correct.

提交回复
热议问题