strcasestr(3)

✨ strcasestr β€” string case-insensitive search substring ✨

okay bestie so listen πŸ’– this one is a <string.h> girlie from the Standard C library (libc, -lc) and she is SO underrated. no cap.


🌸 SYNOPSIS 🌸

#define _GNU_SOURCE  // See feature_test_macros(7)
#include <string.h>

char *strcasestr(const char *haystack, const char *needle);
heads up queen πŸ‘‘ you literally cannot use this without that #define _GNU_SOURCE line first. it's giving gatekept, but that's just how GNU rolls. go read feature_test_macros(7) if you wanna know why, iykyk.

πŸ’… DESCRIPTION πŸ’…

So strcasestr() is basically strstr()'s cooler twin 🫢 she finds your *needle* inside your *haystack*… except she ignores the case of BOTH arguments. both!! not one, both. iconic behaviour honestly.

capital letters, lowercase letters, she does not care, she is unbothered, she is thriving πŸ¦‹


πŸŽ€ RETURN VALUE πŸŽ€

bestie i'm not gonna lie to you, this section just points you at strstr(3). go check that one, it's got the whole story ✨


⭐ ATTRIBUTES ⭐

if you wanna know what these words even mean, attributes(7) has the lore πŸ“–

  • Interface: strcasestr()
    • Attribute: Thread safety
    • Value: MT-Safe locale

so yes she's thread safe, but read the fine print: it's MT-Safe locale β€” locale enters the chat πŸŒ€


🌈 STANDARDS 🌈

GNU. that's it. that's the whole section. she's a GNU original and she said what she said πŸ’œ


🧚 HISTORY 🧚

GNU. again. same vibe. GNU from the start, no notes πŸ’€


πŸ“ SEE ALSO πŸ“


and that's the whole page bestie!! stay case-insensitive, stay unbothered, and if anyone asks β€” this was served fresh from Linux man-pages 6.20, dated 2026-05-16 🌸 periodt πŸ’–βœ¨

πŸ“¦ 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