]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/strspn.3
All pages: Remove the 5th argument to .TH
[thirdparty/man-pages.git] / man3 / strspn.3
1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
2 .\"
3 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
4 .\"
5 .\" References consulted:
6 .\" Linux libc source code
7 .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
8 .\" 386BSD man pages
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)"
11 .SH NAME
12 strspn, strcspn \- get length of a prefix substring
13 .SH LIBRARY
14 Standard C library
15 .RI ( libc ", " \-lc )
16 .SH SYNOPSIS
17 .nf
18 .B #include <string.h>
19 .PP
20 .BI "size_t strspn(const char *" s ", const char *" accept );
21 .BI "size_t strcspn(const char *" s ", const char *" reject );
22 .fi
23 .SH DESCRIPTION
24 The
25 .BR strspn ()
26 function calculates the length (in bytes) of the initial
27 segment of
28 .I s
29 which consists entirely of bytes in
30 .IR accept .
31 .PP
32 The
33 .BR strcspn ()
34 function calculates the length of the initial
35 segment of
36 .I s
37 which consists entirely of bytes not in
38 .IR reject .
39 .SH RETURN VALUE
40 The
41 .BR strspn ()
42 function returns the number of bytes in
43 the initial segment of
44 .I s
45 which consist only of bytes
46 from
47 .IR accept .
48 .PP
49 The
50 .BR strcspn ()
51 function returns the number of bytes in
52 the initial segment of
53 .I s
54 which are not in the string
55 .IR reject .
56 .SH ATTRIBUTES
57 For an explanation of the terms used in this section, see
58 .BR attributes (7).
59 .ad l
60 .nh
61 .TS
62 allbox;
63 lbx lb lb
64 l l l.
65 Interface Attribute Value
66 T{
67 .BR strspn (),
68 .BR strcspn ()
69 T} Thread safety MT-Safe
70 .TE
71 .hy
72 .ad
73 .sp 1
74 .SH STANDARDS
75 POSIX.1-2001, POSIX.1-2008, C89, C99, SVr4, 4.3BSD.
76 .SH SEE ALSO
77 .BR index (3),
78 .BR memchr (3),
79 .BR rindex (3),
80 .BR strchr (3),
81 .BR string (3),
82 .BR strpbrk (3),
83 .BR strsep (3),
84 .BR strstr (3),
85 .BR strtok (3),
86 .BR wcscspn (3),
87 .BR wcsspn (3)