MCPcopy
hub / github.com/Textualize/rich / remove_suffix

Method remove_suffix

rich/text.py:543–550  ·  view source on GitHub ↗

Remove a suffix if it exists. Args: suffix (str): Suffix to remove.

(self, suffix: str)

Source from the content-addressed store, hash-verified

541 return self
542
543 def remove_suffix(self, suffix: str) -> None:
544 """Remove a suffix if it exists.
545
546 Args:
547 suffix (str): Suffix to remove.
548 """
549 if self.plain.endswith(suffix):
550 self.right_crop(len(suffix))
551
552 def get_style_at_offset(self, console: "Console", offset: int) -> Style:
553 """Get the style of a character at give offset.

Callers 1

_get_syntaxMethod · 0.80

Calls 1

right_cropMethod · 0.95

Tested by

no test coverage detected