Skip to content

Instantly share code, notes, and snippets.

@markwatson
Created May 2, 2011 08:32
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 markwatson/951307 to your computer and use it in GitHub Desktop.
Save markwatson/951307 to your computer and use it in GitHub Desktop.
Super Split
def super_split(string, delim):
segment = ''
for c in string:
if c in delim:
yield segment
segment = ''
else:
segment += c
yield segment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment