DragonFly On-Line Manual Pages
STRCHR(3) DragonFly Library Functions Manual STRCHR(3)
strchr, strrchr, strrchrnul -- locate character in string
Standard C Library (libc, -lc)
strchr(const char *s, int c);
strrchr(const char *s, int c);
strchrnul(const char *s, int c);
The strchr() function locates the first occurrence of c (converted to a
char) in the string pointed to by s. The terminating nul character is
considered part of the string; therefore if c is `\0', the functions
locate the terminating `\0'.
The strrchr() function is identical to strchr() except it locates the
last occurrence of c.
The strchrnul() function is identical to strchr() except that it returns
a pointer to the terminating nul character of s instead of NULL if c is
The functions strchr() and strrchr() return a pointer to the located
character, or NULL if the character does not appear in the string.
strchrnul() returns a pointer to the located character, or to the termi-
nating nul character of s if c is not found in the string.
memchr(3), memmem(3), strcspn(3), strpbrk(3), strsep(3), strspn(3),
The functions strchr() and strrchr() conform to ISO/IEC 9899:1990
The strchrnul() function first appeared in glibc 2.1.1
DragonFly 3.5 March 3, 2013 DragonFly 3.5