2 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
6 .\" References consulted:
7 .\" Linux libc source code
8 .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
10 .\" Modified Sat Jul 24 17:57:50 1993 by Rik Faith (faith@cs.unc.edu)
11 .TH strspn 3 (date) "Linux man-pages (unreleased)"
13 strspn, strcspn \- get length of a prefix substring
16 .RI ( libc ", " \-lc )
19 .B #include <string.h>
21 .BI "size_t strspn(const char *" s ", const char *" accept );
22 .BI "size_t strcspn(const char *" s ", const char *" reject );
27 function calculates the length (in bytes) of the initial
30 which consists entirely of bytes in
35 function calculates the length of the initial
38 which consists entirely of bytes not in
43 function returns the number of bytes in
44 the initial segment of
46 which consist only of bytes
52 function returns the number of bytes in
53 the initial segment of
55 which are not in the string
58 For an explanation of the terms used in this section, see
64 Interface Attribute Value
70 T} Thread safety MT-Safe
75 POSIX.1-2001, C89, SVr4, 4.3BSD.