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
  • ๐Ÿ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms