strchr(9)
π strchr(9)
okay so real talk β this is the Kernel API Manual page for strchr, and honestly? it's a short one but it eats. let's get into it bestie π
β¨ NAME β¨
strchr β find the first occurrence of a character in a string. that's it. that's the whole job. main character energy of string functions ngl π¦
πΈ SYNOPSIS πΈ
char * strchr (const char *s , int c );
look at that signature. so clean. so iconic. const char *s goes in, int c goes in, char * comes out. chef's kiss π₯
π ARGUMENTS π
sβ the string you're searching through, bestie. the whole haystack. πΎcβ the character you're hunting for. the needle. the one. π
π DESCRIPTION π
here's the little detail that makes everybody go "wait, what" π β the NUL-terminator is considered part of the string, and you can search for it. no cap. that trailing zero is not exempt, it's a full member of the string, it pays rent, it gets searched. β¨
so yeah, if you go looking for'\0',strchrwill happily find it for you. the end of the string is not off-limits. π«Ά
π SEE ALSO π
okay this list is genuinely a whole squad β the kernel file lives at ./lib/string.c, and these are all the besties it runs with:
strncasecmp(9)stpcpy(9)strcmp(9)strncmp(9)strchrnul(9)strnchrnul(9)strrchr(9)strnchr(9)strspn(9)strcspn(9)strpbrk(9)strsep(9)memset(9)memset16(9)memset32(9)memset64(9)memcpy(9)memmove(9)memcmp(9)bcmp(9)memscan(9)strstr(9)strnstr(9)memchr(9)memchr_inv(9)
literally the entire friend group. iykyk ππ
and that's the page, babes π§ this one comes to you from ./lib and it's dated October 2026 β strchr(9), signed, sealed, slayed. go find your character. βπ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms