title: Splitting string on commas when data can contain commas
body: <p>I have a CSV file (which I didn't design and I can't change now nor will I ever be able to change it) that contains lines like the following:</p>
  
  <p><code>"Surname, Firstname", yes, no, somestring, whatever, etc</code></p>
  
  <p>As you can see here, the first <code>,</code> is not a comma on which I'd want to split the string. Notice that this particular comma is enclosed within the quotation marks.</p>
  
  <p>Because of this, a simple <code>string.split(',')</code> obviously won't work, as it would give me an array of length 7 for the above string instead of 6. </p>
  
  <p>Is there a way to get around this? I was thinking of using regex to split the string instead but I'm not competent enough in regex to think of a pattern that would only split on commas that are not enclosed inside quotation marks. </p>
  
  <p>I can think of ugly, hacky ways to do it by reading each string char by char but this would have to be a last resort as I'm sure there's a better way to do it!</p>