]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/strspn.3
c043ecc0861d3c8db56900388576fc562234a5fd
[thirdparty/man-pages.git] / man3 / strspn.3
1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
2 .\"
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
7 .\"
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
12 .\"
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date. The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein. The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" %%%LICENSE_END
24 .\"
25 .\" References consulted:
26 .\" Linux libc source code
27 .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
28 .\" 386BSD man pages
29 .\" Modified Sat Jul 24 17:57:50 1993 by Rik Faith (faith@cs.unc.edu)
30 .TH STRSPN 3 2012-05-10 "" "Linux Programmer's Manual"
31 .SH NAME
32 strspn, strcspn \- search a string for a set of bytes
33 .SH SYNOPSIS
34 .nf
35 .B #include <string.h>
36 .sp
37 .BI "size_t strspn(const char *" s ", const char *" accept );
38 .sp
39 .BI "size_t strcspn(const char *" s ", const char *" reject );
40 .fi
41 .SH DESCRIPTION
42 The
43 .BR strspn ()
44 function calculates the length (in bytes) of the initial
45 segment of \fIs\fP which consists entirely of bytes in
46 \fIaccept\fP.
47 .PP
48 The
49 .BR strcspn ()
50 function calculates the length of the initial
51 segment of \fIs\fP which consists entirely of bytes not in
52 \fIreject\fP.
53 .SH RETURN VALUE
54 The
55 .BR strspn ()
56 function returns the number of bytes in
57 the initial segment of \fIs\fP which consist only of bytes
58 from \fIaccept\fP.
59 .PP
60 The
61 .BR strcspn ()
62 function returns the number of bytes in
63 the initial segment of \fIs\fP which are not in the string
64 \fIreject\fP.
65 .SH CONFORMING TO
66 SVr4, 4.3BSD, C89, C99.
67 .SH SEE ALSO
68 .BR index (3),
69 .BR memchr (3),
70 .BR rindex (3),
71 .BR strchr (3),
72 .BR string (3),
73 .BR strpbrk (3),
74 .BR strsep (3),
75 .BR strstr (3),
76 .BR strtok (3),
77 .BR wcscspn (3),
78 .BR wcsspn (3)