Skip to content

Instantly share code, notes, and snippets.

@nolim1t
Created May 27, 2009 07:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nolim1t/118506 to your computer and use it in GitHub Desktop.
Save nolim1t/118506 to your computer and use it in GitHub Desktop.
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