def strip_control_sequences(string): """ remove non-print text sequences from `string`. """ global _STRIP_ANSI if not _STRIP_ANSI: from evennia.utils.ansi import strip_raw_ansi as _STRIP_ANSI return _RE_CONTROL_CHAR.sub('', _STRIP_ANSI(string))
def strip_control_sequences(string): """ Remove non-print text sequences. Args: string (str): Text to strip. Returns. text (str): Stripped text. """ global _STRIP_ANSI if not _STRIP_ANSI: from evennia.utils.ansi import strip_raw_ansi as _STRIP_ANSI return _RE_CONTROL_CHAR.sub('', _STRIP_ANSI(string))