```python
def strip_ends(text: str, mark: str) -> str:
    """The text with a character removed from both of its ends."""
    while text.startswith(mark):
        text = text[1:]
    while text.endswith(mark):
        text = text[:-1]
    return text
```