title: Google Docs Script Issue with Split through Function
body: <p>First time poster here for Google Script related services, hopefully I put it in the right place! I'm encountering an error and I can't seem to find the right terminology to look up a solution. Below is the function. Within it I have a variable, string1, that I apply the split to. If I hard-code the value of the string (in the line commented out in the string), then it works and I receive the correct output. If, on the other hand, I try to pass that string into the function from another function, I receive the following error:</p>
  
  <p>"TypeError: Cannot find function split in object Wed Oct 30 2013 09:00:26 GMT-0400 (EDT),danno,ticket,netid,request,mac,Error - Invalid Mac / Mac Not Found."</p>
  
  <p>Note: My call to the function looks like this - formatEmailRow(completeEmailArray[i])</p>
  
  <pre><code>function formatEmailRow(rowToFormat) {
    var formattedString = "";
    var array1 = [];
    var string1 = "";
    ///////////////////////
    string1 = rowToFormat;
    //string1 ="10/30/2013 9:00:26,danno,ticket,netid,request,mac,Error  - Invalid Mac / Mac Not Found ";
    ///////////////////////
    array1 = string1.split(",| ,|, ");
    if (array1 != ""){
    for (var i = 0; i &lt; array1.length; i++) {
    formattedString = formattedString + "     " +(array1[i]);
    }}
    return formattedString;
    }
  </code></pre>
  
  <p>Please help! 
  Thanks ahead of time, any advice is appreciated!</p>
  
  <p>-Danno</p>