title: Java Regex - Using String's replaceAll method to replace newlines
body: <p>I have a string and would like to simply replace all of the newlines in it with the string <code>" --linebreak-- "</code>.</p>
  
  <p>Would it be enough to just write:</p>
  
  <pre><code>string = string.replaceAll("\n", " --linebreak-- ");
  </code></pre>
  
  <p>I'm confused with the regex part of it. Do I need two slashes for the newline? Is this good enough?</p>