|
||
char *strtok( char *s1, char *s2 )
char *s1; /* input string */ char *s2; /* token string */
|
|
|
Synopsis |
#include "string.h"
A sequence of strtok calls may be used to split string s1 into tokens (sequences of characters not in string s2), separated by one or more characters from string s2 . The first call to strtok should pass a non-NULL s1 . Subsequent calls should pass NULL , indicating to strtok that it is to continue from the end of the previous token. When a token is identified, a null character is written into the location where the next character from s2 is found following the token.
|
|
Parameters |
s1 and s2 are null-terminated strings. |
|
Return Value |
A pointer to the start of the current token is returned; when no more tokens are found, NULL is returned. |
|
|
|