1*61193Sbostic.\" Copyright (c) 1990, 1991, 1993 2*61193Sbostic.\" The Regents of the University of California. All rights reserved. 341947Sbostic.\" 441947Sbostic.\" This code is derived from software contributed to Berkeley by 541947Sbostic.\" Chris Torek. 641947Sbostic.\" %sccs.include.redist.man% 741947Sbostic.\" 8*61193Sbostic.\" @(#)index.3 8.1 (Berkeley) 06/04/93 941947Sbostic.\" 1048351Scael.Dd 1148351Scael.Dt INDEX 3 1248351Scael.Os 1348351Scael.Sh NAME 1448351Scael.Nm index 1548351Scael.Nd locate character in string 1648351Scael.Sh SYNOPSIS 1748351Scael.Fd #include <string.h> 1848351Scael.Ft char * 1948351Scael.Fn index "const char *s" "int c" 2048351Scael.Sh DESCRIPTION 2148351ScaelThe 2248351Scael.Fn index 2348351Scaelfunction 2448351Scaellocates the first character matching 2548351Scael.Fa c 2641947Sbostic(converted to a 2748351Scael.Em char ) 2841947Sbosticin the null-terminated string 2948351Scael.Fa s . 3048351Scael.Sh RETURN VALUES 3152229SbosticA pointer to the character is returned if it is found; otherwise 3248351Scael.Dv NULL 3348351Scaelis returned. 3441947SbosticIf 3548351Scael.Fa c 3641947Sbosticis '\e0', 3748351Scael.Fn index 3841947Sbosticlocates the terminating '\e0'. 3948351Scael.Sh SEE ALSO 4048351Scael.Xr memchr 3 , 4148351Scael.Xr rindex 3 , 4248351Scael.Xr strchr 3 , 4348351Scael.Xr strcspn 3 , 4448351Scael.Xr strpbrk 3 , 4548351Scael.Xr strrchr 3 , 4648351Scael.Xr strsep 3 , 4748351Scael.Xr strspn 3 , 4848351Scael.Xr strstr 3 , 4948351Scael.Xr strtok 3 5048351Scael.Sh HISTORY 5148351ScaelA 5248351Scael.Fn index 5348351Scaelfunction appeared in 5448351Scael.At v6 . 55