strchr(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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', strchr will 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:

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