Created
May 27, 2009 07:30
-
-
Save nolim1t/118506 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def countwordsInString(string, delimiter, word): | |
occurs = 0 | |
stringarray = string.split(delimiter) | |
for stringword in stringarray: | |
if word == stringword: | |
occurs = occurs + 1 | |
return occurs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment