Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
many_line solution in Clear category for Between Markers by wii_caiji
def between_markers(text: str, begin: str, end: str) -> str:
if begin not in text and end in text:
return text[:text.index(end)]
if begin in text and end not in text:
return text[text.index(begin)+len(begin):]
if begin not in text and end not in text:
return text
if text.index(begin) > text.index(end):
return ''
return text[text.index(begin)+len(begin):text.index(end)]
July 27, 2020