I am trying to write an ANSI C++ compatible routine to parse a string such as the following that is delimited by a comma(,)
123,456,abc,,def
Into
Field1=123
Field2=456
Field3=abc
Field4=
Field5=def
I could use strtok, but it does not handle an empty token and
returns Field4=def.
I know that I could use some character by character logic to
pick off the values, but I'm hoping there is something better
available, while still using ANSI C++ standard code.
Please help!!