title: How to delete specific parts of a google docs using google Apps script
body: <p>I'm would like to edit text in a google doc, specifically: 
  <br> 1) I want to delete an element of text between the first letter in the document and a predefined stop point ("//", in this case).</p>
  
  <p>I've unsuccessuflly tried doing something like this: <br></p>
  
  <pre><code>    var rangeElement = DocumentApp.openById(fileID).getBody().findText("//");
            if (rangeElement.isPartial()) {
              var startOffset = rangeElement.getStartOffset([0]);
              var endOffset = rangeElement.getEndOffsetInclusive("//");
            rangeElement.getElement().asText().deleteText(startOffset,endOffset);} 
  </code></pre>
  
  <p>Any help would be greatly appreciated. Thank you for your time.</p>