I have a string like this abc & "def&ghi" & jkl & "mno&pqr"
and want to do a split aroung &
, but i don't want to split words within double quotes.
Output should be abc, "def&ghi", jkl, "mno&pqr"
.
I tried doing a split("&")
on that string, but that's also splitting the words within double quotes.
Whats the best way of doing this?