strrchr

Searches for the last occurrence of a specified character in a character string

#include <strings.h>
        char *strrchr (
        const char *s,
        long c
)

Arguments

s Pointer to a character string
c Target character

Return Value

A pointer to the last occurrence of the character c within the string pointed to by s is returned. NULL is returned if c cannot be found within the string.

Explanation

The last occurrence of the character c is located in the character string pointed to by s. A pointer to the located character is returned.