Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

check how many times a substring appears in a string

a = '128532012'
print(a.count('0'))
#Prints: 1

print(a.count('12'))
#Prints: 2
 
PREVIOUS NEXT
Tagged: #check #times #substring #appears #string
ADD COMMENT
Topic
Name
9+2 =