.TH strspn() "" "" "String Function (libc)"
.PC "Return length a string includes characters in another"
.B "#include <string.h>"
\fBunsigned int strspn(\fIstring1\^\fB, \fIstring2\^\fB)\fR
\fBchar *\fIstring1\^\fB; char *\fIstring2\^\fB;\fR
.PP
.II "string, comparison"
.II "compare strings"
.B strspn()
returns the length for which
.I string1
initially consists only of characters that are found in
.IR string2 .
For example,
.DM
	char *s1 = "hello, world";
	char *s2 = "kernighan & ritchie";
	strcspn(s1, s2);
.DE
.PP
returns two, which is the length for which the first string
initially consists of characters found in the second.
.SH "See Also"
.Xr "libc," libc
.Xr "string.h" string.h
.br
\*(AS, \(sc7.11.5.6
.br
\*(PX Standard, \(sc8.1
