Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Find start end solution in Clear category for Between Markers (simplified) by Striga
def between_markers(text: str, begin: str, end: str) -> str:
start = text.find(begin) + len(begin)
end = text.find(end)
return text[start:end]
if __name__ == '__main__':
assert between_markers('What is >apple<', '>', '<') == "apple"
assert between_markers('What is [apple]', '[', ']') == "apple"
assert between_markers('What is ><', '>', '<') == ""
assert between_markers('>apple<', '>', '<') == "apple"
Sept. 26, 2020
Comments: