DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
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
COMMENT
Name
9+2 =
Submit