-> Click here to learn how to get live help <-
NAMEstrsep - extract token from string
#include <string.h> char *strsep(char **stringp, const char *delim);
DESCRIPTIONIf *fIstringpfP is NULL, the fBstrsep()fP function returns NULL and does nothing else. Otherwise, this function finds the first token in the string *fIstringpfP, where tokens are delimited by symbols in the string fIdelimfP. This token is terminated with a ` ' character (by overwriting the delimiter) and *fIstringpfP is updated to point past the token. In case no delimiter was found, the token is taken to be the entire string *fIstringpfP, and *fIstringpfP is made NULL.
RETURN VALUEThe fBstrsep()fP function returns a pointer to the token, that is, it returns the original value of *fIstringpfP.
NOTESThe fBstrsep()fP function was introduced as a replacement for fBstrtok()fP, since the latter cannot handle empty fields. However, fBstrtok()fP conforms to ANSI-C and hence is more portable.
BUGSThis function suffers from the same problems as fBstrtok()fP. In particular, it modifies the original string. Avoid it.
CONFORMING TOBSD 4.4
SEE ALSOindex(3), memchr(3), rindex(3), strchr(3), strpbrk(3), strspn(3), strstr(3), strtok(3)