How to find the index of first occurrence of substring after a specific index in Python

1 Answer

0 votes
s = 'python java c c++ python c# php'
substring = 'python'
i = 10

index = s.find(substring, i)
print(index)  
   
   
   
'''
run:
   
18
 
'''

 



answered Oct 28, 2020 by avibootz
edited Oct 28, 2020 by avibootz
...