Debian Codegraph @

upstream/fedora-44/man3/string.3

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