Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

7 lines (5 sloc) 0.187 kb
def substring(haystack, needle, n):
parts= haystack.split(needle, n+1)
if len(parts)<=n+1:
return haystack
return haystack[:len(haystack)-len(parts[-1])-len(needle)]
Jump to Line
Something went wrong with that request. Please try again.