“Last Index Of” for Python Strings
In Java and C#, there is a method that enables you to find the last occurrence of a given sequence of string characters within a string. This method is sometimes called “lastIndexOf.” A method by this name does not exist in Python. But there is an easy way to do it if you know what you are looking for.
The method is rfind, which could be translated into “find from the right side.” See below.
x = "abc,def,ghi" print x.rfind(",") // 7