title: Convert string to matrix (array)
body: <p>i have a string , and i want to put in an array using google apps script, i start to creation function for this but i couldn't do it properly, someone can help me please.
  my string is in this form : "key,type, val, key, type, val,key,type, val...."
  i want to put in every line of my matrix the key and the type and val.</p>
  
  <p>enter code here</p>
  
  <pre><code>function (tasks_data)
  {
  var data [];
  var cpt=-1;
      while(tasks_data.length&gt;0)
      {
      data[cpt ]= new array();
      var key =tasks_data.substring (0,tasks_data.indexof(','));
      var type= tasks_data.substring(0,tasks_data.indexof(','));  
      var val =tasks_data.substring (0,tasks_data.indexof(','));
  cpt++;                       
  return tasks_data;
  }
  }
  </code></pre>