Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!texbell!nuchat!moray!urchin!p6.f506.n106.z1.fidonet.org!Bob.Stout From: Bob.Stout@p6.f506.n106.z1.fidonet.org (Bob Stout) Newsgroups: comp.lang.c Subject: strrchr() Message-ID: <7408.25974EFE@urchin.fidonet.org> Date: 25 Dec 89 18:46:32 GMT Sender: ufgate@urchin.fidonet.org (newsout1.26) Organization: FidoNet node 1:106/506.6 - Fulcrum's Edge, Spring TX Lines: 10 The strrchr() function is the ANSI equivalent of the older rindex() function (sort of - implementations differ). It returns a pointer to the last char in an array matching the char specified. Its equivalent function for matching the first char is strchr(). Example: char *test = "abcdefgfedcba"; puts(strchr(test, 'd')); /* prints "defgfedcba" */ puts(strrchr(test, 'd')); /* prints "dcba" */