清理空格
(text: str)
| 152 | |
| 153 | |
| 154 | def clean_spaces(text: str) -> str: |
| 155 | """清理空格""" |
| 156 | if not text: |
| 157 | return "" |
| 158 | # 去除首尾空格 |
| 159 | text = text.strip() |
| 160 | # 多个空格合并为一个 |
| 161 | text = re.sub(r'\s+', ' ', text) |
| 162 | return text |
| 163 | |
| 164 | |
| 165 | def is_usable_name(text: str) -> bool: |
no outgoing calls
no test coverage detected