Mwnci rindex() Function

Syntax

rindex(data,search)

Description

The rindex() function returns the position (indicated as an integer) in a string or array at which search string begins, or -1 if string does not occur in the string or array. The first position is 0. Unlike index(), this function starts the search from then end of the array or string.

Example

a="this is a string" 
b=["this", "is", "an", "array"]
println(rindex(a, "str"))
println(rindex(b, "an"))


10
2