.\" Copyright (c) 1990, 1991 The Regents of the University of California. .\" All rights reserved. .\" .\" This code is derived from software contributed to Berkeley by .\" Chris Torek. .\" %sccs.include.redist.man% .\" .\" @(#)rindex.3 5.2 (Berkeley) 04/19/91 .\" .Dd .Dt RINDEX 3 .Os .Sh NAME .Nm rindex .Nd locate character in string .Sh SYNOPSIS .Fd #include .Ft char * .Fn rindex "const char *s" "int c" .Sh DESCRIPTION The .Fn rindex function locates the last character matching .Fa c (converted to a .Em char ) in the null-terminated string .Fa s . The character c is returned if it is found; otherwise NULL is returned. If .Fa c is .Ql \e0 , .Fn rindex locates the terminating .Ql \e0 . .Sh SEE ALSO .Xr index 3 , .Xr memchr 3 , .Xr strchr 3 , .Xr strcspn 3 , .Xr strpbrk 3 , .Xr strrchr 3 , .Xr strsep 3 , .Xr strspn 3 , .Xr strstr 3 , .Xr strtok 3 .Sh HISTORY A .Fn rindex function appeared in .At v6 .