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