📜  超级字符串计数器 - 任何代码示例

📅  最后修改于: 2022-03-11 15:00:13.354000             🧑  作者: Mango

代码示例1
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