1STRSPN(3)                  Linux Programmer's Manual                 STRSPN(3)
2
3
4

NAME

6       strspn, strcspn - get length of a prefix substring
7

SYNOPSIS

9       #include <string.h>
10
11       size_t strspn(const char *s, const char *accept);
12
13       size_t strcspn(const char *s, const char *reject);
14

DESCRIPTION

16       The  strspn()  function calculates the length (in bytes) of the initial
17       segment of s which consists entirely of bytes in accept.
18
19       The strcspn() function calculates the length of the initial segment  of
20       s which consists entirely of bytes not in reject.
21

RETURN VALUE

23       The  strspn()  function returns the number of bytes in the initial seg‐
24       ment of s which consist only of bytes from accept.
25
26       The strcspn() function returns the number of bytes in the initial  seg‐
27       ment of s which are not in the string reject.
28

ATTRIBUTES

30       For   an   explanation   of   the  terms  used  in  this  section,  see
31       attributes(7).
32
33       ┌────────────────────┬───────────────┬─────────┐
34Interface           Attribute     Value   
35       ├────────────────────┼───────────────┼─────────┤
36strspn(), strcspn() │ Thread safety │ MT-Safe │
37       └────────────────────┴───────────────┴─────────┘

CONFORMING TO

39       POSIX.1-2001, POSIX.1-2008, C89, C99, SVr4, 4.3BSD.
40

SEE ALSO

42       index(3),  memchr(3),  rindex(3),  strchr(3),  string(3),   strpbrk(3),
43       strsep(3), strstr(3), strtok(3), wcscspn(3), wcsspn(3)
44

COLOPHON

46       This  page  is  part of release 4.15 of the Linux man-pages project.  A
47       description of the project, information about reporting bugs,  and  the
48       latest     version     of     this    page,    can    be    found    at
49       https://www.kernel.org/doc/man-pages/.
50
51
52
53                                  2015-08-08                         STRSPN(3)
Impressum