I want to split a string on whitespace, but keep strings that are between 
quotes:
    
    
    input: spam eggs "spam and eggs"
    output: @["spam", "eggs", "spam and eggs"]

I want to support both single and double quotes, and I'm having trouble 
wrapping my brain around how to do this. I've been thinking maybe splitting 
with a regular expression is the way to go, but I wondered if there is a 
simpler way (perhaps already in the standard library that I've missed).

Reply via email to