C string (string.h) Library
C string Functions
The <string.h> library has many functions that allow you to perform tasks on strings.
A list of all string functions can be found in the table below:
| Function | Description |
|---|---|
| memchr() | Returns a pointer to the first occurrence of a value in a block of memory |
| memcmp() | Compares two blocks of memory to determine which one represents a larger numeric value |
| memcpy() | Copies data from one block of memory to another |
| memmove() | Copies data from one block of memory to another accounting for the possibility that the blocks of memory overlap |
| memset() | Sets all of the bytes in a block of memory to the same value |
| strcat() | Appends one string to the end of another |
| strchr() | Returns a pointer to the first occurrence of a character in a string |
| strcmp() | Compares the ASCII values of characters in two strings to determine which string has a higher value |
| strcoll() | Compares the locale-based values of characters in two strings to determine which string has a higher value |
| strcpy() | Copies the characters of a string into the memory of another string |
| strcspn() | Returns the length of a string up to the first occurrence of one of the specified characters |
| strerror() | Returns a string describing the meaning of an error code |
| strlen() | Return the length of a string |
| strncat() | Appends a number of characters from a string to the end of another string |
| strncmp() | Compares the ASCII values of a specified number of characters in two strings to determine which string has a higher value |
| strncpy() | Copies a number of characters from one string into the memory of another string |
| strpbrk() | Returns a pointer to the first position in a string which contains one of the specified characters |
| strrchr() | Returns a pointer to the last occurrence of a character in a string |
| strspn() | Returns the length of a string up to the first character which is not one of the specified characters |
| strstr() | Returns a pointer to the first occurrence of a string in another string |
| strtok() | Splits a string into pieces using delimiters |
| strxfrm() | Convert characters in a string from ASCII encoding to the encoding of the current locale |