euporie.core.ft.utils.strip

euporie.core.ft.utils.strip(ft: StyleAndTextTuples, left: bool = True, right: bool = True, chars: str | None = None, only_unstyled: bool = False) StyleAndTextTuples

Strip whitespace (or a given character) from the ends of formatted text.

Parameters
  • ft – The formatted text to strip

  • left – If True, strip from the left side of the input

  • right – If True, strip from the right side of the input

  • chars – The character to strip. If None, strips whitespace

  • only_unstyled – If True, only strip unstyled fragments

Returns

The stripped formatted text