[ create a new paste ] login | about

Link: http://codepad.org/XqAu8VRz    [ raw code | fork ]

Python, pasted on Jan 23:
1
2
3
4
5
6
7
8
9
10
from string import *
def countSubStringMatch(target, key):
    """iteratively counts the number of instances of the key in the target string"""
    zz = find(target,key)
    num = 0
    while zz!=-1:
        num = num + 1
        zz = find(target,key,zz+1)
    return num
    


Create a new paste based on this one


Comments: