char *strsep(char **stringp,
             const char *delim);

strsep locates, in the string referenced by *stringp, the first occurrence of any character in the string delim (or the terminating null character) and replaces it with a null character. The location of the next character after the delimiter character (or NULL, if the end of the string was reached) is stored in *stringp. The original value of *stringp is returned.

An empty field (that is, a character in the string delim occurs as the first character of *stringp can be detected by comparing the location referenced by the returned pointer to the null character.

If *stringp is initially null, strsep returns null.


strsep is an extension commonly found in Linux and BSD C libraries.