Simple string split problem
Hallo guys,
I have string like a html tags , which has many attributes , I want to seperate each of them
code:
<Configuration Name="Release|Win32" OutputDirectory="Release " IntermediateDirectory="../../../../output.tmp/Release/CacheTest/" ConfigurationType="1" CharacterSet="2">
I used strstr and strtok functions to seperate it using the white spaces , but its useless, as some of the values in quotes have whitespaces too.
Looking forward to your reply guys.
mfg,
kings
Re: Simple string split problem
Looks like a quote followed by a space is your field delimiter.
Re: Simple string split problem
seems to me the solution is a bit of brute force: incrementally go throught the target string but keep a flag that indicates whether you have an unbalanced quote at any point in time. the idea is that white space will not constitute the end of a token being built if the quotes are unbalanced.