Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
map(text.find, ...) and tuple-if slicing solution in Clear category for Between Markers by A5537
def between_markers(text: str, begin: str, end: str) -> str:
start, stop = map(text.find, (begin, end))
return text[(start + len(begin), 0)[start < 0]:(stop, None)[stop < 0]]
March 11, 2019
Comments: