1.\" Copyright (c) 1990, 1991, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" This code is derived from software contributed to Berkeley by 5.\" Chris Torek. 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: 9.\" 1. Redistributions of source code must retain the above copyright 10.\" notice, this list of conditions and the following disclaimer. 11.\" 2. Redistributions in binary form must reproduce the above copyright 12.\" notice, this list of conditions and the following disclaimer in the 13.\" documentation and/or other materials provided with the distribution. 14.\" 3. All advertising materials mentioning features or use of this software 15.\" must display the following acknowledgement: 16.\" This product includes software developed by the University of 17.\" California, Berkeley and its contributors. 18.\" 4. Neither the name of the University nor the names of its contributors 19.\" may be used to endorse or promote products derived from this software 20.\" without specific prior written permission. 21.\" 22.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 23.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 26.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32.\" SUCH DAMAGE. 33.\" 34.\" @(#)string.3 8.2 (Berkeley) 12/11/93 35.\" 36.Dd December 11, 1993 37.Dt STRING 3 38.Os BSD 4 39.Sh NAME 40.Nm strcat , 41.Nm strncat , 42.Nm strchr , 43.Nm strrchr , 44.Nm strcmp , 45.Nm strncmp , 46.Nm strcasecmp, 47.Nm strncasecmp , 48.Nm strcpy , 49.Nm strncpy , 50.Nm strerror , 51.Nm strlen , 52.Nm strpbrk , 53.Nm strsep, 54.Nm strspn , 55.Nm strcspn , 56.Nm strstr , 57.Nm strtok , 58.Nm index , 59.Nm rindex 60.Nd string specific functions 61.Sh SYNOPSIS 62.Fd #include <string.h> 63.Ft char * 64.Fn strcat "char *s" "const char * append" 65.Ft char * 66.Fn strncat "char *s" "const char *append" "size_t count" 67.Ft char * 68.Fn strchr "const char *s" "int c" 69.Ft char * 70.Fn strrchr "const char *s" "int c" 71.Ft int 72.Fn strcmp "const char *s1" "const char *s2" 73.Ft int 74.Fn strncmp "const char *s1" "const char *s2" "size_t count" 75.Ft int 76.Fn strcasecmp "const char *s1" "const char *s2" 77.Ft int 78.Fn strncasecmp "const char *s1" "const char *s2" "size_t count" 79.Ft char * 80.Fn strcpy "char *dst" "const char *src" 81.Ft char * 82.Fn strncpy "char *dst" "const char *src" "size_t count" 83.Ft char * 84.Fn strerror "int errno" 85.Ft size_t 86.Fn strlen "const char *s" 87.Ft char * 88.Fn strpbrk "const char *s" "const char *charset" 89.Ft char * 90.Fn strsep "char **stringp" "const char *delim" 91.Ft size_t 92.Fn strspn "const char *s" "const char *charset" 93.Ft size_t 94.Fn strcspn "const char *s" "const char *charset" 95.Ft char * 96.Fn strstr "const char *big" "const char *little" 97.Ft char * 98.Fn strtok "char *s" "const char *delim" 99.Ft char * 100.Fn index "const char *s" "int c" 101.Ft char * 102.Fn rindex "const char *s" "int c" 103.Sh DESCRIPTION 104The string 105functions manipulate strings terminated by a 106null byte. 107.Pp 108See the specific manual pages for more information. 109For manipulating variable length generic objects as byte 110strings (without the null byte check), see 111.Xr bstring 3 . 112.Pp 113Except as noted in their specific manual pages, 114the string functions do not test the destination 115for size limitations. 116.Sh SEE ALSO 117.Xr index 3 , 118.Xr strcat 3 , 119.Xr strchr 3 , 120.Xr strrchr 3 , 121.Xr strcmp 3 , 122.Xr strcasecmp 3 , 123.Xr strcpy 3 , 124.Xr strerror 3 , 125.Xr strlen 3 , 126.Xr strpbrk 3 , 127.Xr strsep 3 , 128.Xr strspn 3 , 129.Xr strcspn 3 , 130.Xr strstr 3 , 131.Xr strtok 3 , 132.Xr rindex 3 133.Xr bstring 3 134.Sh STANDARDS 135The 136.Fn strcat , 137.Fn strncat , 138.Fn strchr , 139.Fn strrchr , 140.Fn strcmp , 141.Fn strncmp , 142.Fn strcpy , 143.Fn strncpy , 144.Fn strerror , 145.Fn strlen , 146.Fn strpbrk , 147.Fn strsep , 148.Fn strspn , 149.Fn strcspn , 150.Fn strstr , 151and 152.Fn strtok 153functions 154conform to 155.St -ansiC . 156