1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
3 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .\" References consulted:
6 .\" Linux libc source code
7 .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
9 .\" Modified Sat Jul 24 17:57:50 1993 by Rik Faith (faith@cs.unc.edu)
10 .TH STRSPN 3 2021-03-22 "Linux man-pages (unreleased)"
12 strspn, strcspn \- get length of a prefix substring
15 .RI ( libc ", " \-lc )
18 .B #include <string.h>
20 .BI "size_t strspn(const char *" s ", const char *" accept );
21 .BI "size_t strcspn(const char *" s ", const char *" reject );
26 function calculates the length (in bytes) of the initial
29 which consists entirely of bytes in
34 function calculates the length of the initial
37 which consists entirely of bytes not in
42 function returns the number of bytes in
43 the initial segment of
45 which consist only of bytes
51 function returns the number of bytes in
52 the initial segment of
54 which are not in the string
57 For an explanation of the terms used in this section, see
65 Interface Attribute Value
69 T} Thread safety MT-Safe
75 POSIX.1-2001, POSIX.1-2008, C89, C99, SVr4, 4.3BSD.