title: How to remove substring from the cell in google sheets via script
body: <p>I am trying to automate the process of parsing data in one of my columns. So far I have it so that after applying a formula I get the data I need but with text around it.
  I would like to find and replace the cell values such that I only have the data that is in quotations marks without the quotations. How would I do this via script? Refer to the picture below. This is what I have so far:</p>
  <pre><code>var src = &quot;:utm_source=&gt;&quot;;
    var med = &quot;:utm_medium=&gt;&quot;;
    var camp = &quot;:utm_campaign=&gt;&quot;;
    var term = &quot;:utm_term=&gt;&quot;;
    var con = &quot;:utm_content=&gt;&quot;;
    var r1 = &quot;&quot;;
    var data = sheet.getDataRange().getValues();
    Logger.log(data.length);
    for (var i = 0; i &lt; data[0].length;i++){
      for (var j = 0; j &lt; data.length;j++){
        Logger.log(data[j][i]);
        if(data[j][i].indexOf(src) &gt; -1 || data[j][i].indexOf(med) &gt; -1 || data[j][i].indexOf(camp) &gt; -1 || data[j][i].indexOf(term) &gt; -1 || data[j][i].indexOf(con) &gt; -1){
        sheet.getRange(j+1,i+1).setValue(r1);
          sheet
        }
      }
    }
  </code></pre>
  <p><img src="https://i.stack.imgur.com/CgBWc.png" alt="picture of data and desired result" /></p>