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