str.rfind (sub, start, end)
sub: It`s the substring which needs to be searched in the given string.
start: Starting position where sub is needs to be checked within the string.
end: Ending position where suffix is needs to be checked within the string.
NOTE. If no start and end indices are supplied, then it defaults to 0 and length-1 as start and end indices, where end indices are not included in our search.
Return: returns the highest substring index, if found in the given string; if not found, -1 is returned.
ValueError: This error occurs when the argument string is not found in the target string.
CODE # 1
Substring `geeks` found at index: 10 Substring` for` found at index: 6 Substring `ate` found at index: 13
CODE # 2
< br />
10 10 -1 6
Useful when validating strings. Check if the given substring is present in any string or not.
Doesn`t contains given substring