I’m trying to parse a delimited string that has some empty parameters.
Example:
"|One|two|three||octopus|garbagecan||cartwheel||||"
Basically I need to be able to pull out any segment by id, and if the segment is empty return null.
strtok() doesn’t handle the empty fields, and it looks like there is strsep() for *nix based systems. Anyone know if there is something similar for Windows? I want to try and avoid having to write a function to handle this if I can.
Just write the function using its description, it’s not terribly complex: