GLProgramming.com

home :: about :: development guides :: irc :: forums :: search :: paste :: links :: contribute :: code dump

-> Click here to learn how to get live help <-


Manpage of STRSEP

STRSEP

Index
 

NAME

strsep - extract token from string  

SYNOPSIS

#include <string.h>

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

DESCRIPTION

If *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 VALUE

The fBstrsep()fP function returns a pointer to the token, that is, it returns the original value of *fIstringpfP.  

NOTES

The 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.  

BUGS

This function suffers from the same problems as fBstrtok()fP. In particular, it modifies the original string. Avoid it.  

CONFORMING TO

BSD 4.4  

SEE ALSO

index(3), memchr(3), rindex(3), strchr(3), strpbrk(3), strspn(3), strstr(3), strtok(3)


 

Index

NAME
SYNOPSIS
DESCRIPTION
RETURN VALUE
NOTES
BUGS
CONFORMING TO
SEE ALSO