You are viewing a single comment's thread. Return to all comments →
count = 0 start = 0 while start <= len(string) - len(sub_string): pos = string.find(sub_string, start) if pos != -1: count += 1 start = pos + 1 else: break return count
Seems like cookies are disabled on this browser, please enable them to open this website
Find a string
You are viewing a single comment's thread. Return to all comments →