I have a string like this, as you can see it consists of property/value pairs separated by space. For example: GRID "GLOBAL"
or COORD 0
GRID "GLOBAL" LABEL "A" DIR "X" COORD 0 GRIDTYPE " "
The TEXT values are inside quotation marks but the NUMERICAL ones are not.
What is the best and fastest method to split it into an array of strings like this:
[GRID ,"GLOBAL", LABEL, "A", DIR, "X", COORD, 0, GRIDTYPE, " "]
The below solution does not work, because there is also space between " " in the value after GRIDTYPE
.
var tokens = str.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);