Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def Count_Substring(STR, SUB_STR):
- SUB_LEN = len(SUB_STR)
- Counter = 0
- for i in range (len(STR)):
- if STR[i] == SUB_STR[0]:
- TEMP = STR[i:i+SUB_LEN]
- if TEMP == SUB_STR:
- Counter += 1
- return Counter
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement