<p>Given a string like this:</p>

<blockquote>
  <p>a,"string, with",various,"values, and some",quoted</p>
</blockquote>

<p>What is a good algorithm to split this based on commas while ignoring the commas inside the quoted sections?</p>

<p>The output should be an array:</p>

<blockquote>
  <p>[ "a", "string, with", "various", "values, and some", "quoted" ]</p>
</blockquote>

Of course using a CSV parser is better but just for the fun of it you could:
```
```
Loop on the string letter by letter.
    If current_letter == quote : 
        toggle inside_quote variable.
    Else if (current_letter ==comma and not inside_quote) : 
        push current_word into array and clear current_word.
    Else 
        append the current_letter to current_word
When the loop is done push the current_word into array
```
```