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