SysTutorials

Man Pages › Section 3

index(3)

NAME

index, rindex – locate character in string

SYNOPSIS


#include <strings.h>
char *index(const char *s, int c);
char *rindex(const char *s, int c);

DESCRIPTION

The index() function returns a pointer to the first occurrence of the character c in the string s.

The rindex() function returns a pointer to the last occurrence of the character c in the string s.

The terminating null byte (‘