.TH strpbrk() "" "" "String Function (libc)"
.PC "Find first occurrence of a character from another string"
.B "#include <string.h>"
\fBchar *strpbrk(\fIstring1\^\fB, \fIstring2\^\fB)\fR
\fBchar *\fIstring1\^\fB, *\fIstring2\^\fB;\fR
.PP
.II "search string for character"
.II "string, search for character"
.II "character, search string for"
.B strpbrk()
returns a pointer to the first character in
.I string1
that matches any character in
.IR string2 .
It returns NULL if no character in
.I string1
matches a character in
.IR string2 .
.PP
The set of characters that
.I string2
points to is sometimes called the \*(QLbreak string\*(QR.
For example,
.DM
	char *string = "To be, or not to be: that is the question.";
	char *brkset = ",;";
	strpbrk(string, brkset);
.DE
.PP
returns the value of the pointer \fBstring\fR plus five.
This points to the comma, which is the first character in the area pointed
to by \fBstring\fR that matches any character in the string pointed to by
\fBbrkset\fR.
.SH "See Also"
.Xr "libc," libc
.Xr "string.h" string.h
.br
\*(AS, \(sc7.11.5.4
.br
\*(PX Standard, \(sc8.1
.SH Notes
.B strpbrk()
resembles the function
.B strtok()
in functionality, but unlike
.BR strtok() ,
it preserves the contents of the strings being compared.
It also resembles the function
.BR strchr() ,
but lets you search for any one of a group of characters,
rather than for one character alone.
