Answers for "What is the index of the last occurrence of the word"

3

find last appearance python

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

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 "What is the index of the last occurrence of the word"

Python Answers by Framework

Browse Popular Code Answers by Language