title: System.lineSeparator() not working as expected on Windows
body: <p>I have a method that takes an string as input, and takes away from it all the spaces and newline characters on it. To achieve this I'm using the following methods from the java libraries:</p>
  
  <pre><code>public String clean(String s) {
      return s.replaceAll(System.lineSeparator(),"").replaceAll(" ","");
  }
  </code></pre>
  
  <p>This is working fine under Linux, but when it comes to windows, it isn't able to remove the line separator characters, as the string contains them.</p>
  
  <p>Is there something I'm missing? I know in Unix based systems the newline character is /n and I have no clue what might it be in Windows, but as the java documentation says, the System.lineSeparator() method should provide a platform-independent line separator character.</p>