wcspbrk(3)
π wcspbrk(3) β the wide-char glow-up of strpbrk π
okay bestie, so this one lives in the Library Functions Manual section 3, and it's a libc girlie. let's get into it β¨
β¨ NAME β¨
wcspbrk β search a wide-character string for any of a set of wide characters
like. she's the friend who scans the whole group chat to find out if anyone said the thing π«Ά
π LIBRARY π
Standard C library (libc, -lc)
so you already have her. no extra package, no side quest, she's just there. queen behavior π
π SYNOPSIS π
#include <wchar.h>
wchar_t *wcspbrk(const wchar_t *wcs, const wchar_t *accept);
πΈ DESCRIPTION πΈ
okay so real talk. wcspbrk() is the wide-character equivalent of the strpbrk(3) function. that's the whole vibe β same energy, but for wchar_t strings instead of plain char strings π¦
what she actually does: she searches for the first occurrence in the wide-character string pointed to by wcs of any of the characters in the wide-character string pointed to by accept.
so likeβ¦ accept is the guest list π and wcs is the party π and she walks down the line going "do I know you? do I know you?" and the second she finds someone on the list, she grabs them and points at them. iconic. no cap.
it's giving "which one of you is on the list" and she does NOT read past the first match. main character energy fr fr π
π₯ RETURN VALUE π₯
wcspbrk() returns a pointer to the first occurrence in wcs of any of the characters listed in accept.
and if wcs contains none of these characters? you get NULL. no match, no pointer, no nothing. she says "nobody's on the list bestie, we're going home" π
π ATTRIBUTES π
for an explanation of the terms used in this section, see attributes(7).
wcspbrk()β Thread safety: MT-Safe β
translation: multi-threaded? she does not care. she's not out here starting drama with your other threads. safe to share, safe to vibe, no locking required π
π STANDARDS π
C11, POSIX.1-2008.
she's certified. she's official. she's in the standard, periodt β¨
π HISTORY π
POSIX.1-2001, C99.
she's been around. an OG. she was doing wide-character matching before it was cool πΈ
π¦ SEE ALSO π¦
strpbrk(3)β her narrow-char sisterwcschr(3)β finds ONE specific char, not a whole setwcscspn(3)β counts how far you can go without hitting the set
go read those too, they're all part of the same friend group π«Ά
and that's the whole page! this little love letter to wcspbrk(3) shipped as part of Linux man-pages 6.20, dated 2026-02-08. ty for reading, ily, go write some wide-char code ππβ¨
π¦ 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: GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms