Skip to content

Instantly share code, notes, and snippets.

@spitz-dan-l
Created May 30, 2014 20:16
Show Gist options
  • Save spitz-dan-l/466f13c90c5bebce761f to your computer and use it in GitHub Desktop.
Save spitz-dan-l/466f13c90c5bebce761f to your computer and use it in GitHub Desktop.
def remove_spans_neg(s, spans):
return ''.join(s[i:j] for (_, i), (j, _) in zip([(None,0)]+spans, spans+[(len(s),None)]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment