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_SOURCEline first. it's giving gatekept, but that's just how GNU rolls. go readfeature_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
- 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