I'm using strtok
in the hope of doing something like Php's explode
.
At first I thought the following was working correctly
details = strtok(line,"]:");
But after some closer inspection I realised it was using any instance of ]
and :
to split the string. What I need is for it to only split the string where the two are together - ]:
.
Maybe strtok
is the wrong function for this? I played around with str_split
but this didn't work, either through my implementation or unsuitability.
Any help welcome on splitting my string where an occurrence of ]:
is found.