def strip_by_delim(text: str, start: str, end: str) -> str:
    """Strip text by delimiter."""
    if (start in text) and (end in text):
        def find_start() -> int:
            return text.index(start)

        def find_end() -> int:
            return text.index(end) + len(end)

        return text[:find_start()] + text[find_end():]
    else:
        return text