Name | Description | Notes | Source | Availability | |||||||
---|---|---|---|---|---|---|---|---|---|---|---|
strchr() |
Search string for first occurance of character | (·) | <string.h> |
C89 | C90 | C95 | C99 | C11 | |||
strcspn() |
Search string for longest span of complement of set of characters | (·) | <string.h> |
C89 | C90 | C95 | C99 | C11 | |||
strpbrk() |
Search string for first of set of characters | (·) | <string.h> |
C89 | C90 | C95 | C99 | C11 | |||
strrchr() |
Search string for last occurance of character | (·) | <string.h> |
C89 | C90 | C95 | C99 | C11 | |||
strspn() |
Search string for longest span of set of characters | (·) | <string.h> |
C89 | C90 | C95 | C99 | C11 | |||
strstr() |
Search string for string | (·) | <string.h> |
C89 | C90 | C95 | C99 | C11 | |||
wcschr() |
Search wide-character string for first occurance of character | (·) | <wchar.h> |
C95 | C99 | C11 | |||||
wcscspn() |
Search wide-character string for longest span of complement of set of characters | (·) | <wchar.h> |
C95 | C99 | C11 | |||||
wcspbrk() |
Search wide-character string for first of set of characters | (·) | <wchar.h> |
C95 | C99 | C11 | |||||
wcsrchr() |
Search wide-character string for last occurance of character | (·) | <wchar.h> |
C95 | C99 | C11 | |||||
wcsspn() |
Search wide-character string for longest span of set of characters | (·) | <wchar.h> |
C95 | C99 | C11 | |||||
wcsstr() |
Search wide-character string for string | (·) | <wchar.h> |
C95 | C99 | C11 |
#include <string.h>
char *strchr(const char *in, int c);
#include <wchar.h>
wchar_t *wcschr(const wchar_t *in, wchar_t c);
strchr
and
wcschr
search a null-terminated string
in
for a character c
, and return a pointer to its earliest occurance,
or return NULL
if not found.
#include <string.h>
char *strrchr(const char *in, int c);
#include <wchar.h>
wchar_t *wcsrchr(const wchar_t *in, wchar_t c);
strrchr
and
wcsrchr
search a null-terminated string
in
for a character c
, and return a pointer to its latest occurance,
or return NULL
if not found.
#include <string.h>
char *strpbrk(const char *in, const char *set);
#include <wchar.h>
wchar_t *wcspbrk(const wchar_t *in, const wchar_t *set);
strpbrk
and
wcspbrk
search a null-terminated string
in
for any character in the
null-terminated string set
, and return
a pointer to the earliest occurance, or return NULL
if not found.
#include <string.h>
char *strstr(const char *in, const char *str);
#include <wchar.h>
wchar_t *wcsstr(const wchar_t *in, const wchar_t *str);
strstr
and wcsstr
search a null-terminated string in
for
the null-terminated string set
, and
return a pointer to the earliest occurance, or return
NULL
if not found.
#include <string.h>
size_t strspn(const char *in, const char *set);
#include <wchar.h>
size_t wcsspn(const wchar_t *in, const wchar_t *set);
strspn
and
wcsspn
search a null-terminated string
in
for the longest prefix consisting
only of characters in the null-terminated string set
, and return the length of that prefix.
#include <string.h>
size_t strcspn(const char *in, const char *set);
#include <wchar.h>
size_t wcscspn(const wchar_t *in, const wchar_t *set);
strcspn
and
wcscspn
search a null-terminated string
in
for the longest prefix consisting
only of characters not in the null-terminated string
set
, and return the length of that
prefix.