Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

strrchr - get last occurrence of character in string

&pagelevel(4)&pagelevel

Syntax

#include <string.h>

char *strrchr(const char *s, int c);

Description

strrchr() searches for the last occurrence of character c in string s and returns a pointer to the located position in s if successful.

The terminating null byte (\0) is also considered as a character.

Return val.

Pointer to the position of c in string s


if successful.

Null pointer

if c is not contained in string s.

Notes

See also

The functions strrchr() and rindex() are equivalent.

index(), rindex(), strchr(), string.h.