string(3) Library Functions Manual string(3) NAME stpcpy, strcasecmp, strcat, strchr, strcmp, strcoll, strcpy, strcspn, strdup, strfry, strlen, strncat, strncmp, strncpy, strncasecmp, strpbrk, strrchr, strsep, strspn, strstr, strtok, strxfrm - string operations LIBRARY Standard C library (libc, -lc) SYNOPSIS #include #include DESCRIPTION The string functions perform operations on null-terminated strings. See the individual man pages for descriptions of each function. strcasecmp(3) Compare two strings, ignoring case. strncasecmp(3) Compare the first bytes of two strings, ignoring case. stpcpy(3) Copy a string, returning a pointer to the end of the resulting string. strcat(3) Append a string into an existing string. strchr(3) Find the first occurrence of a character in a string. strcmp(3) Compare two strings. strcoll(3) Compare two strings, using the current locale. strcpy(3) Copy a string. strcspn(3) Calculate the length of the initial segment of a string which does not contain any of the rejected bytes. strdup(3) Duplicate a string in memory allocated using malloc(3). strfry(3) Randomly swap the characters in a string. strlen(3) Return the length of a string. strncat(3) Append non-null bytes from an array to a string, and null-terminate the result. strncmp(3) Compare the first bytes of two strings. strpbrk(3) Find the first occurrence in a string of one of the bytes in the ac- cepted bytes. strrchr(3) Find the last occurrence of a character in a string. strsep(3) Extract the initial field in a string that is delimited by one of the delimiter bytes. strspn(3) Calculate the length of the initial segment of a string that con- sists entirely of accepted bytes. strstr(3) Find the first occurrence of a substring in a string. strtok(3) Extract tokens from a string that are delimited by one of the delim- iter bytes. strxfrm(3) Transforms a string to the current locale and copies the first bytes to a buffer. strncpy(3) Fill a fixed-size buffer with leading non-null bytes from a source array, padding with null bytes as needed. SEE ALSO bstring(3), stpcpy(3), strcasecmp(3), strcat(3), strchr(3), strcmp(3), str- coll(3), strcpy(3), strcspn(3), strdup(3), strfry(3), strlen(3), strn- casecmp(3), strncat(3), strncmp(3), strncpy(3), strpbrk(3), strrchr(3), strsep(3), strspn(3), strstr(3), strtok(3), strxfrm(3) Linux man-pages 6.18 2026-02-25 string(3)