char * strsep

char * strsep(char **, const char *)

The strsep() function locates, in the string referenced by *sp, the first occurrence of any character in the string delim (or the terminating '\0' character) and replaces it with a '\0'. The location of the next character after the delimiter character (or NULL, if the end of the string was reached) is stored in *sp. An ``empty'' field, i.e. one caused by two adjacent delimiter characters, can be detected by comparing the location referenced by the pointer returned in *sp to '\0'.


The strsep() function returns a pointer to the original value of *sp. If *sp is initially NULL, strsep() returns NULL.