Debian Codegraph @

upstream/mageia-cauldron/man3/string.3

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