str.rfind (sub [, start [, end]])-> < span id = "area_func_result"> int
sub - Substring whose final placement index you want to determine.
start = 0 - Index the beginning of the slice in the source string where you want to find the substring.
end = None - The index of the end of the slice in the source string where you want to find the substring.
If the substring is not found, it returns
Search for a substring is performed from right to left (hence the
r prefix in the method name
my_str = `barbarian`
my_str.rfind (` bar`) # 3
my_str.rfind (`bar`, 1) # 3
my_str.rfind (` bar`, 1, 2) # -1
endcan take any values supported by the mechanism slices .
See also: str.find () .