title: How do i replace a double line with a single line in a string in Android?
body: <p>I have a string: </p>
  
  <pre><code> This is a test sentence 1.
   This is a test sentence 2.
   This is a test sentence 3.
  
   This is a test sentence 4.
  
   This is a test sentence 5.
  </code></pre>
  
  <p>I would like to replace the double line gap with a single line instead. Such as:</p>
  
  <pre><code> This is a test sentence 1.
   This is a test sentence 2.
   This is a test sentence 3.
   This is a test sentence 4.
   This is a test sentence 5.
  </code></pre>
  
  <p>However, I do not know how to detect the double line break, "\n" works when replacing a single line break but i have tried "\n\n" in a replace function with no success.  </p>
  
  <pre><code>textView.setText(string.replaceAll("\n\n","\n"));
  </code></pre>