📅  最后修改于: 2022-03-11 14:57:31.059000             🧑  作者: Mango
def count_substring(string, sub_string):
count = 0
for i in range(len(string)):
if string[i:].startswith(sub_string):
count += 1
return count