iI have a string that iI am reading from another system. itsIt's basically a long string that represents a list of key value pairs that are separated by a space in between. ItIt looks like this:
key:value[space]key:value[space]key:value[space]
so iSo I wrote this code to parse it:
string myString = ReadinString();
string[] tokens = myString.split(' ');
foreach (string token in tokens) {
string key = token.split(':')[0];
string value = token.split(':')[1];
. . . .
}
theThe issue now is that some of the values have spaces in them so my "simplistic" split at the top no longer works. iI wanted to see how iI could still parse out the list of key value pairs (given space as a separator character) now that iI know there also could be spaces in the value field as split doesn't seem like itsit's going to be able to work anymore.
NOTE: I now confirmed that KEYs will NOT have spaces in them so iI only have to worry about Valuesthe values. Apologies for the confusion.