Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Between Markers by dx2-66
def between_markers(text: str, begin: str, end: str) -> str:
"""
returns substring between two given markers
"""
start_pos = text.find(begin)
end_pos = text.find(end)
return text[(start_pos + len(begin) if start_pos!=-1 else None):(end_pos if end_pos!=-1 else None)]
Dec. 29, 2021