title: Remove line breaks using apps scripts in a Google Document
body: <p>Trying to work out how to remove multiple line breaks from Google Documents (not spreadsheets).</p>
  
  <p>I've tried this and many variations thereof:</p>
  
  <pre><code>function searchAndReplace() {
    var bodyElement = DocumentApp.getActiveDocument().getBody();
    bodyElement.replaceText("\r\r", '\r');
  }
  </code></pre>
  
  <p>Any idea please?
  Noob to all of this...</p>
  
  <p>Purpose is to replicate the search and replace in MS Word for ^p</p>