python string count
Python hosting: Host, run, and code Python in the cloud!
Return the number of substrings in string.
Syntax
The format is:
str.count(sub) |
or
str.count(sub,start,end) |
Parameters
Sub substring to count
Example
str = "The string count method returns the number of sub string occurences. " |
Result:
2
Posted in documentation
Leave a Reply: