rindex

# given 'explain the unexplainable'

$string->rindex('explain'); # 14
$string->rindex('explain', 0); # 0
$string->rindex('explain', 21); # 14
$string->rindex('explain', 22); # 14
$string->rindex('explain', 23); # 14
$string->rindex('explain', 20); # 14
$string->rindex('explain', 14); # 0
$string->rindex('explain', 13); # 0
$string->rindex('explain', 0); # 0
$string->rindex('explained'); # -1

The rindex method searches for the argument within the string and returns the position of the last occurrence of the argument. This method optionally takes a second argument which would be the position within the string to start searching from (beginning at or before the position). By default, starts searching from the end of the string. This method returns a data type object to be determined after execution.

rindex(Str $arg1, Num $arg2) : NumObject

method

5 POD Errors

The following errors were encountered while parsing the POD:

Around line 10:

Unknown directive: =name

Around line 14:

Unknown directive: =usage

Around line 29:

Unknown directive: =description

Around line 38:

Unknown directive: =signature

Around line 42:

Unknown directive: =type