```python
def strip_ends(text: str, mark: str) -> str:
    """The text with a character removed from both of its ends."""
    if len(mark) != 1:
        raise ValueError("mark must be a single character")
    
    out = text
    if out.startswith(mark):
        out = out[1:]
    if out.endswith(mark):
        out = out[:-1]
    return out
```