Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- global pointer
- def countSubStringMatchRecursive(target1,key):
- count=0
- #pointer=0
- print 'Parent String',target1
- print 'Match key',key
- pointer=subrecfn(target1,key) # returns the pointer of the last match.
- if pointer!=-1:
- count+=1
- target1= target1[pointer:]
- subrecfn(target1,key)
- else:
- print 'No more matches!'
- break
- print 'Total count',counts
- def subrecfn(target,key):
- #int pointer## Is this valid in Python, if yes then the function isnt necessary!
- pointer=find(target,key)
- return pointer
Add Comment
Please, Sign In to add comment