SysTutorials

Man Pages › Section 3

strsep(3)

strsep – extract token from string

Synopsis

#include <string.h>

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

Feature Test Macro Requirements for glibc (see feature_test_macros(7)): strsep():
    Since glibc 2.19:
        _DEFAULT_SOURCE
    Glibc 2.19 and earlier:
        _BSD_SOURCE

Description

If *stringp is NULL, the strsep() function returns NULL and does nothing else. Otherwise, this function finds the first token in the string *stringp, that is delimited by one of the bytes in the string delim. This token is terminated by overwriting the delimiter with a null byte (‘