Table of Contents

# $EPIC: rindex.txt,v 1.2 2007/03/02 02:32:04 jnelson Exp $

Synopsis:

$rindex(<characters> <text>)

Technical:

Practical:

It used to be common to use $rindex() to find a character in a string so that you could extract the parts of the string before and after the character. This is more easily done by $before() and $after() though.

Returns:

  -1   no character in <characters> was found in <text>
> -1   index to last instance of something in <characters> in <text>

History

This function originally appeared in ircII-2.1.3

Examples:

$rindex(abc hello there bob)         returns 14
$rindex(abc   hello there bob)       returns 16
 (because of the spaces after 'c' and before 'h')
$rindex(xyz hello there bob)         returns -1
$rindex()                            returns the empty string