How to split a string twice?

I know how to split once, like:
juce::StringArray allTokens;
allTokens.addTokens (devMidiWindow.getText (), “\n”, “”");

But say I have data like:
G# min,F# maj,C# maj,G# min,F# maj,C# maj
D# min,C# maj,B maj,C# 6(sus4),C# maj,G# min,F# maj,C# maj
G# min add 9,F# maj add 9,G# min add 9,F# maj add 9

and I want to split it first on newlines, THEN on commas, so it turns into an array of arrays of strings, like:
{{G# min,F# maj,C# maj,G# min,F# maj,C# maj},{D# min,C# maj,B maj,C# 6(sus4),C# maj,G# min,F# maj,C# maj}…}

I don’t know how to do this because the addTokens method requires an existing string array, and since I don’t know in advance how many I need, I would have to use the new keyword in a loop (I think??) and push them into a vector.

I’m just new and haven’t used new keyword or smart pointers before, and am not sure if I even need to do that.

Thanks in advance!

juce::Array<juce::StringArray> result;
juce::StringArray lines;
lines.addTokens( devMidiWindow.getText(), "\n", "\""  );
for ( auto& line: lines )
{
    juce::StringArray chords;
    chords.addTokens( line, ",", "\"" );
    result.add( chords );
}

Man, I basically already had this written out, idk what I was confused about.
Thanks!