获取字符串的实际显示宽度
(s)
| 96 | |
| 97 | @staticmethod |
| 98 | def get_string_display_width(s): |
| 99 | """获取字符串的实际显示宽度""" |
| 100 | width = 0 |
| 101 | s = Colors.remove_color(s) |
| 102 | for char in s: |
| 103 | width += TablePrinter.get_char_width(char) |
| 104 | return width |
| 105 | |
| 106 | @staticmethod |
| 107 | def pad_string_with_chinese(s, target_width): |
no test coverage detected