Answers for "python find last index of substring"

5

python index of last occurrence in string

>>> s = 'hello'
>>> s.rfind('l')
3
Posted by: Guest on October-02-2020
0

python search a string in another string get last result

# Where in the text is the last occurrence of the string "casa"?
txt = "Mi casa, su casa."

x = txt.rfind("casa")

print(x)
Posted by: Guest on January-23-2021

Code answers related to "python find last index of substring"

Python Answers by Framework

Browse Popular Code Answers by Language