You are viewing a single comment's thread. Return to all comments →
def count_substring(string, sub_string): count = 0; str_len = len(string) sub_len = len(sub_string) i=0 while i< (str_len-sub_len+1): index = string.find(sub_string, i) if index != -1: count = count + 1 i = index i = i+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 →