Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
without 're module' solution in Clear category for Between Markers by SuperSaid09
def between_markers(text: str, begin: str, end: str) -> str:
if end not in text and begin not in text:
pass
elif begin not in text:
text = text[:text.index(end)]
elif end not in text:
text = text[text.index(begin) + len(begin):]
else:
text = text[text.index(begin) + len(begin):text.index(end)]
return text
Nov. 23, 2020