# string.h - [Overview](#section1515866369165629) - [Summary](#section432837237165629) - [Macros](#define-members) - [Functions](#func-members) ## **Overview** **Related Modules:** [UTILS](UTILS.md) **Description:** Declares commonly used functions for string operations. You can use the functions provided in this file to perform the mathematical operations required during development. The operations include copying, searching for, locating, and appending a string, as well as comparing two strings. You must pay attention to memory management during function calls. **Since:** 1.0 **Version:** 1.0 ## **Summary** ## Macros
memcpy (void *__restrict dest, const void *__restrict src, size_t n) |
|
memmove (void *dest, const void *src, size_t n) |
|
memset (void *s, int c, size_t n) |
|
memcmp (const void *s1, const void *s2, size_t n) |
|
memchr (const void *s, int c, size_t n) |
|
strcpy (char *dest, const char *src) |
|
strncpy (char *dest, const char *src, size_t n) |
|
strcat (char *dest, const char *src) |
|
strncat (char *dest, const char *src, size_t n) |
|
strcmp (const char *s1, const char *s2) |
|
strncmp (const char *s1, const char *s2, size_t n) |
|
strcoll (const char *s1, const char *s2) |
Compares two strings by character for the program's current locale. |
strcoll_l (const char *s1, const char *s2, locale_t locale) |
|
strxfrm (char *dest, const char *src, size_t n) |
Converts the first n characters of the source string pointed to by src based on the program's current locale specified by LC_COLLATE, and places them in the destination string pointed to by dest. |
strchr (const char *s, int c) |
|
strrchr (const char *s, int c) |
|
strcspn (const char *s, const char *reject) |
Obtains the length of the initial segment of a string that contains characters not in reject. |
|
Obtains the length of the initial segment of a string that contains characters in accept. |
|
strstr (const char *haystack, const char *needle) |
|
strtok (char *str, const char *delim) |
Separates a string into a series of tokens separated by a delimiter. |
strlen (const char *s) |
|
strerror (int errnum) |
Obtains an error description string of the specified error code. |
strtok_r (char *str, const char *delim, char **saveptr) |
Separates a string into a series of tokens separated by a delimiter, with the saveptr parameter specified. |
strerror_l (int errnum, locale_t locale) |
Obtains an error description string of the specified error code for the specified locale. |
strerror_r (int errnum, char *buf, size_t buflen) |
Obtains an error description string of the specified error code. |
stpcpy (char *dest, const char *src) |
|
stpncpy (char *dest, const char *src, size_t n) |
|
strnlen (const char *s, size_t maxlen) |
|
strdup (const char *s) |
|
strndup (const char *s, size_t n) |
|
strsignal (int sig) |
|
memccpy (void *__restrict dest, const void *__restrict src, int c, size_t n) |
|
strsep (char **stringp, const char *delim) |
Separates a string into a series of tokens separated by a delimiter. |
strlcat (char *d, const char *s, size_t n) |
|
strlcpy (char *d, const char *s, size_t n) |
|
strverscmp (const char *s1, const char *s2) |
Compares strings of two versions (string 1 and string 2) and returns the comparison result. |
strcasestr (const char *haystack, const char *needle) |
Searches for a needle string in its haystack string and returns a pointer. |
memmem (const void *haystack, size_t haystacklen, const void *needle, size_t needlelen) |
|
memrchr (const void *s, int c, size_t n) |
|
mempcpy (void *dest, const void *src, size_t n) |