You are viewing a single comment's thread. Return to all comments →
Slightly modified the answer from matheus_santos5:
def count_substring(string, sub_string): count = 0 for i in range(len(string)): if string[i:].startswith(sub_string): count += 1 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 →
Slightly modified the answer from matheus_santos5: