| 1 |
.\" Copyright 1993, David Metcalfe <[email protected]> |
| 2 |
.\" Copyright, the authors of the Linux man-pages project |
| 3 |
.\" |
| 4 |
.\" SPDX-License-Identifier: Linux-man-pages-copyleft |
| 5 |
.\" |
| 6 |
.TH string 3 2026-02-25 "Linux man-pages 6.18" |
| 7 |
.SH NAME |
| 8 |
stpcpy, strcasecmp, strcat, strchr, strcmp, strcoll, strcpy, strcspn, |
| 9 |
strdup, strfry, strlen, strncat, strncmp, strncpy, strncasecmp, strpbrk, |
| 10 |
strrchr, strsep, strspn, strstr, strtok, strxfrm |
| 11 |
\- string operations |
| 12 |
.SH LIBRARY |
| 13 |
Standard C library |
| 14 |
.RI ( libc ,\~ \-lc ) |
| 15 |
.SH SYNOPSIS |
| 16 |
.nf |
| 17 |
.B #include <string.h> |
| 18 |
.B #include <strings.h> |
| 19 |
.fi |
| 20 |
.SH DESCRIPTION |
| 21 |
The string functions perform operations on null-terminated |
| 22 |
strings. |
| 23 |
See the individual man pages for descriptions of each function. |
| 24 |
.TP |
| 25 |
.BR strcasecmp (3) |
| 26 |
Compare two strings, |
| 27 |
ignoring case. |
| 28 |
.TP |
| 29 |
.BR strncasecmp (3) |
| 30 |
Compare the first bytes of two strings, |
| 31 |
ignoring case. |
| 32 |
.TP |
| 33 |
.BR stpcpy (3) |
| 34 |
Copy a string, |
| 35 |
returning a pointer to the end of the resulting string. |
| 36 |
.TP |
| 37 |
.BR strcat (3) |
| 38 |
Append a string into an existing string. |
| 39 |
.TP |
| 40 |
.BR strchr (3) |
| 41 |
Find the first occurrence of a character |
| 42 |
in a string. |
| 43 |
.TP |
| 44 |
.BR strcmp (3) |
| 45 |
Compare two strings. |
| 46 |
.TP |
| 47 |
.BR strcoll (3) |
| 48 |
Compare two strings, |
| 49 |
using the current locale. |
| 50 |
.TP |
| 51 |
.BR strcpy (3) |
| 52 |
Copy a string. |
| 53 |
.TP |
| 54 |
.BR strcspn (3) |
| 55 |
Calculate the length of the initial segment of a string |
| 56 |
which does not contain any of the rejected bytes. |
| 57 |
.TP |
| 58 |
.BR strdup (3) |
| 59 |
Duplicate a string |
| 60 |
in memory allocated using |
| 61 |
.BR malloc (3). |
| 62 |
.TP |
| 63 |
.BR strfry (3) |
| 64 |
Randomly swap the characters in a string. |
| 65 |
.TP |
| 66 |
.BR strlen (3) |
| 67 |
Return the length of a string. |
| 68 |
.TP |
| 69 |
.BR strncat (3) |
| 70 |
Append non-null bytes from an array |
| 71 |
to a string, |
| 72 |
and null-terminate the result. |
| 73 |
.TP |
| 74 |
.BR strncmp (3) |
| 75 |
Compare the first bytes of two strings. |
| 76 |
.TP |
| 77 |
.BR strpbrk (3) |
| 78 |
Find the first occurrence in a string |
| 79 |
of one of the bytes in the accepted bytes. |
| 80 |
.TP |
| 81 |
.BR strrchr (3) |
| 82 |
Find the last occurrence of a character |
| 83 |
in a string. |
| 84 |
.TP |
| 85 |
.BR strsep (3) |
| 86 |
Extract the initial field in a string |
| 87 |
that is delimited by one of the delimiter bytes. |
| 88 |
.TP |
| 89 |
.BR strspn (3) |
| 90 |
Calculate the length of the initial segment of a string |
| 91 |
that consists entirely of accepted bytes. |
| 92 |
.TP |
| 93 |
.BR strstr (3) |
| 94 |
Find the first occurrence of a substring |
| 95 |
in a string. |
| 96 |
.TP |
| 97 |
.BR strtok (3) |
| 98 |
Extract tokens from a string |
| 99 |
that are delimited by one of the delimiter bytes. |
| 100 |
.TP |
| 101 |
.BR strxfrm (3) |
| 102 |
Transforms a string |
| 103 |
to the current locale |
| 104 |
and copies the first bytes to a buffer. |
| 105 |
.TP |
| 106 |
.BR strncpy (3) |
| 107 |
Fill a fixed-size buffer with leading non-null bytes from a source array, |
| 108 |
padding with null bytes as needed. |
| 109 |
.SH SEE ALSO |
| 110 |
.BR bstring (3), |
| 111 |
.BR stpcpy (3), |
| 112 |
.BR strcasecmp (3), |
| 113 |
.BR strcat (3), |
| 114 |
.BR strchr (3), |
| 115 |
.BR strcmp (3), |
| 116 |
.BR strcoll (3), |
| 117 |
.BR strcpy (3), |
| 118 |
.BR strcspn (3), |
| 119 |
.BR strdup (3), |
| 120 |
.BR strfry (3), |
| 121 |
.BR strlen (3), |
| 122 |
.BR strncasecmp (3), |
| 123 |
.BR strncat (3), |
| 124 |
.BR strncmp (3), |
| 125 |
.BR strncpy (3), |
| 126 |
.BR strpbrk (3), |
| 127 |
.BR strrchr (3), |
| 128 |
.BR strsep (3), |
| 129 |
.BR strspn (3), |
| 130 |
.BR strstr (3), |
| 131 |
.BR strtok (3), |
| 132 |
.BR strxfrm (3) |