Skip to content

Instantly share code, notes, and snippets.

@cloudnull
Created November 20, 2014 17:50
Show Gist options
  • Save cloudnull/980def13843a085965f4 to your computer and use it in GitHub Desktop.
Save cloudnull/980def13843a085965f4 to your computer and use it in GitHub Desktop.
multi split function. your welcome. :)
def spliterator(seperators, value, joiner=' '):
"""list of things to split on a value.
:param seperator: ``tuple``
:param value: ``str``
:param joiner: ``str``
"""
def rejoiner(_value):
return joiner.join(_value)
for seperator in seperators:
value = rejoiner(_value=value.split(seperator))
else:
return value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment