2
I have a string in the following format:
0:name:password:email:etc
I need to separate it into each ':', and I’m doing this with the Strtok(string function, ':').
The problem is that the password can be null, and the default is like this:
0:name::email:etc
And then Strtok doesn’t work anymore, because it doesn’t just take the first ':', but both.
Is there any way around this using Strtok, or even doing this process in a smarter way?
Thank you.
What you want to appear if the password or any other option is null ?
– Dev
Nothing, an empty string. The problem is that the function takes the email (in the example) and then messes up the rest of the code.
– Gabriel Távora