1string(3)                  Library Functions Manual                  string(3)
2
3
4

NAME

6       stpcpy,  strcasecmp,  strcat, strchr, strcmp, strcoll, strcpy, strcspn,
7       strdup, strfry, strlen, strncat, strncmp, strncpy,  strncasecmp,  strp‐
8       brk,  strrchr, strsep, strspn, strstr, strtok, strxfrm, index, rindex -
9       string operations
10

LIBRARY

12       Standard C library (libc, -lc)
13

SYNOPSIS

15       #include <strings.h>
16
17       int strcasecmp(const char *s1, const char *s2);
18              Compare the strings s1 and s2 ignoring case.
19
20       int strncasecmp(const char s1[.n], const char s2[.n], size_t n);
21              Compare the first n bytes of the  strings  s1  and  s2  ignoring
22              case.
23
24       char *index(const char *s, int c);
25              Identical to strchr(3).
26
27       char *rindex(const char *s, int c);
28              Identical to strrchr(3).
29
30       #include <string.h>
31
32       char *stpcpy(char *restrict dest, const char *restrict src);
33              Copy  a  string from src to dest, returning a pointer to the end
34              of the resulting string at dest.
35
36       char *strcat(char *restrict dest, const char *restrict src);
37              Append the string src to the string dest,  returning  a  pointer
38              dest.
39
40       char *strchr(const char *s, int c);
41              Return  a  pointer to the first occurrence of the character c in
42              the string s.
43
44       int strcmp(const char *s1, const char *s2);
45              Compare the strings s1 with s2.
46
47       int strcoll(const char *s1, const char *s2);
48              Compare the strings s1 with s2 using the current locale.
49
50       char *strcpy(char *restrict dest, const char *restrict src);
51              Copy the string src to dest, returning a pointer to the start of
52              dest.
53
54       size_t strcspn(const char *s, const char *reject);
55              Calculate  the  length  of  the  initial segment of the string s
56              which does not contain any of bytes in the string reject,
57
58       char *strdup(const char *s);
59              Return a duplicate of the string s  in  memory  allocated  using
60              malloc(3).
61
62       char *strfry(char *string);
63              Randomly swap the characters in string.
64
65       size_t strlen(const char *s);
66              Return the length of the string s.
67
68       char *strncat(char dest[restrict strlen(.dest) + .n + 1],
69                     const char src[restrict .n],
70                     size_t n);
71              Append  at  most n bytes from the unterminated string src to the
72              string dest, returning a pointer to dest.
73
74       int strncmp(const char s1[.n], const char s2[.n], size_t n);
75              Compare at most n bytes of the strings s1 and s2.
76
77       char *strpbrk(const char *s, const char *accept);
78              Return a pointer to the first occurrence in the string s of  one
79              of the bytes in the string accept.
80
81       char *strrchr(const char *s, int c);
82              Return  a  pointer  to the last occurrence of the character c in
83              the string s.
84
85       char *strsep(char **restrict stringp, const char *restrict delim);
86              Extract the initial token in stringp that is delimited by one of
87              the bytes in delim.
88
89       size_t strspn(const char *s, const char *accept);
90              Calculate  the  length  of  the starting segment in the string s
91              that consists entirely of bytes in accept.
92
93       char *strstr(const char *haystack, const char *needle);
94              Find the first occurrence of the substring needle in the  string
95              haystack, returning a pointer to the found substring.
96
97       char *strtok(char *restrict s, const char *restrict delim);
98              Extract  tokens  from  the string s that are delimited by one of
99              the bytes in delim.
100
101       size_t strxfrm(char dest[restrict .n], const char src[restrict .n],
102                      size_t n);
103              Transforms src to the current locale  and  copies  the  first  n
104              bytes to dest.
105
106   Obsolete functions
107       char *strncpy(char dest[restrict .n], const char src[restrict .n],
108                     size_t n);
109              Copy  at  most  n  bytes  from  string  src to dest, returning a
110              pointer to the start of dest.
111

DESCRIPTION

113       The string functions perform  operations  on  null-terminated  strings.
114       See the individual man pages for descriptions of each function.
115

SEE ALSO

117       bstring(3),  stpcpy(3), strcasecmp(3), strcat(3), strchr(3), strcmp(3),
118       strcoll(3), strcpy(3),  strcspn(3),  strdup(3),  strfry(3),  strlen(3),
119       strncasecmp(3),  strncat(3),  strncmp(3),  strncpy(3), strpbrk(3), str‐
120       rchr(3), strsep(3), strspn(3), strstr(3), strtok(3), strxfrm(3)
121
122
123
124Linux man-pages 6.05              2023-01-22                         string(3)
Impressum