strpbrk(3)
โจ strpbrk(3) โ string search characters โจ
okay bestie, gather round, because today we're talking about strpbrk from the Library Functions Manual ๐ it lives in the Standard C library (libc, link it with -lc) and honestly? she's a whole vibe. a slightly confusingly-named vibe. but a vibe.
๐ธ SYNOPSIS ๐ธ
#include <string.h>
char *strpbrk(const char *s, const char *accept);
๐ DESCRIPTION ๐
so here's the tea ๐ strpbrk() goes looking through the string s and finds the first occurrence of any of the bytes in the string accept. like, any single one of them. first one it bumps into? that's the one, no cap.
๐ RETURN VALUE ๐
she gives you back a pointer to the byte in s that matches one of the bytes in accept ๐ซถ and if there is literally no such byte anywhere? you get NULL. sad but true bestie ๐ญ
๐ ATTRIBUTES ๐
for the whole explanation of what these fancy terms even mean, check out attributes(7) (iykyk).
strpbrk()โ Thread safety: MT-Safe โจ (yes queen, multiple threads can hang out here, we love to see it)
๐ STANDARDS ๐
C11, POSIX.1-2008. certified iconic โญ
๐ฆ HISTORY ๐ฆ
POSIX.1-2001, C89, SVr4, 4.3BSD. she's been around since forever, a true legacy main character ๐
๐ BUGS ๐
not me having to say this but... the name of this function is bad ๐ it should have been named strchrs(). the NAME section up above reflects this. we don't make the rules, we just report them ๐ญ
๐ฅ SEE ALSO ๐ฅ
and that's the whole page, periodt ๐ this was Linux man-pages 6.20, dated 2026-08-10 ๐ go forth and search those strings, bestie, you got this ๐ธ๐ซถโจ
๐ฆ where this page comes from
- arch rolling: man-pages 6.20-1 ยท BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages 6.20
- ๐ the page's license: Linux-man-pages-copyleft
- Copyright 1993, David Metcalfe <david@prism.demon.co.uk>
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms