Remove control codes from text. Args: text (str): A string possibly contain control codes. Returns: str: String with control codes removed.
(
text: str, _translate_table: Dict[int, None] = _CONTROL_STRIP_TRANSLATE
)
| 179 | |
| 180 | |
| 181 | def strip_control_codes( |
| 182 | text: str, _translate_table: Dict[int, None] = _CONTROL_STRIP_TRANSLATE |
| 183 | ) -> str: |
| 184 | """Remove control codes from text. |
| 185 | |
| 186 | Args: |
| 187 | text (str): A string possibly contain control codes. |
| 188 | |
| 189 | Returns: |
| 190 | str: String with control codes removed. |
| 191 | """ |
| 192 | return text.translate(_translate_table) |
| 193 | |
| 194 | |
| 195 | def escape_control_codes( |
no outgoing calls