Hi. I need to get a vlaue inside a string with the comma delimiter. is it possible?
Like:
example:
String Vnames = "Roger, Mark, Rose, Paul"
how could I get the "Mark" or the "Rose" for example?
Something like
vnameok = split(Vnames," , ")(2). Where the comma is the delimiter and the (2) is the 3th position.
Yes it is a C string function called "strtok()"
What it does is it reads the buffer and looks for a split character( , . : / ; - ) really any character you want, and it will output what ever is before the split character.
I can't remember if the buffer needs to be null terminated or not, I think it does.
"Hello, it is 1:20 pm. "
Output = strtok( buffer, ",:" ); //"Hello"
Output = strtok( NULL, ",:" );// " it is 1"
Output = strtok( NULL, ".");// "20 pm"
Hi. Tks for answering. I think I can but could you give me an example about how to get the 3th pro exanple:
Like:
variable = "joh, mary,rose,joseph"
I have been searching for this function and strtok seems doesn't do this.
Am I wrong?