STRING(3) | Library Functions Manual | STRING(3)

# NAME

`string` —
string specific functions

# LIBRARY

Standard C Library (libc, -lc)

# SYNOPSIS

`#include <string.h>`

char *
`stpcpy`(char *dst, const char *src);

char *
`stpncpy`(char *dst, const char *src, size_t count);

char *
`strcat`(char *s, const char * append);

size_t
`strlcat`(char *dst, const char *src, size_t size);

char *
`strncat`(char *s, const char *append, size_t count);

char *
`strchr`(const char *s, int c);

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

int
`strcmp`(const char *s1, const char *s2);

int
`strncmp`(const char *s1, const char *s2, size_t count);

int
`strcasecmp`(const char *s1, const char *s2);

int
`strncasecmp`(const char *s1, const char *s2, size_t count);

int
`strcoll`(const char *s1, const char *s2);

char *
`strcpy`(char *dst, const char *src);

size_t
`strlcpy`(char *dst, const char *src, size_t size);

char *
`strncpy`(char *dst, const char *src, size_t count);

char *
`strerror`(int errno);

int
`strerror_r`(int errnum, char *strerrbuf, size_t buflen);

size_t
`strlen`(const char *s);

size_t
`strnlen`(const char *s, size_t count);

char *
`strpbrk`(const char *s, const char *charset);

char *
`strsep`(char **stringp, const char *delim);

char *
`stresep`(char **stringp, const char *delim, int escape);

size_t
`strspn`(const char *s, const char *charset);

size_t
`strcspn`(const char *s, const char *charset);

char *
`strdup`(const char *str);

char *
`strndup`(const char *str, size_t len);

char *
`strstr`(const char *big, const char *little);

char *
`strcasestr`(const char *big, const char *little);

char *
`strtok`(char *s, const char *delim);

char *
`strtok_r`(char *s, const char *delim, char **lasts);

size_t
`strxfrm`(char *dst, const char *src, size_t n);

# DESCRIPTION

The string functions manipulate strings terminated by a nul byte.

See the specific manual pages for more information. For manipulating variable length generic objects as byte strings (without the nul byte check), see bstring(3).

Except as noted in their specific manual pages, the string functions do not test the destination for size limitations.

# SEE ALSO

bstring(3), strcat(3), strchr(3), strcmp(3), strcoll(3), strcpy(3), strcspn(3), strdup(3), strerror(3), strings(3), strlcat(3), strlen(3), strpbrk(3), strrchr(3), strsep(3), strspn(3), strstr(3), strtok(3), strxfrm(3)

# STANDARDS

The `strcat`(), `strncat`(), `strchr`(), `strrchr`(), `strcmp`(), `strncmp`(), `strcpy`(), `strncpy`(), `strcoll`(), `strerror`(), `strlen`(), `strpbrk`(), `strsep`(), `strspn`(), `strcspn`(), `strstr`(), `strtok`(), and `strxfrm`() functions conform to ANSI X3.159-1989 (“ANSI C89”).

The `strtok_r`() function conforms to IEEE Std 1003.1c-1995 (“POSIX.1c”).

The `strerror_r`() function conforms to IEEE Std 1003.1-2001 (“POSIX.1”).

April 26, 2017 | NetBSD 9.5