System.getProperty("line.separator") Vs "\n" for Android

android, httpresponse, java, linux

Solution

If you get line separated responses use `BufferedReader.readLine()` to read each line and then use `System.getProperty("line.separator")` if you want to insert the newline back into the String.

Problem

My query is whether `System.getProperty("line.separator")` and `"\n"` for Android network operations are same. I mean to say. I will be getting line separated response from some server and so which is better to use `System.getProperty("line.separator")` or `"\n"`? reffred Carriage returns/line breaks with \n in strings in Android but still not sure with network operations.

Original source

Related problems