>>import re
>>p=re.compile('\s+')
>>new_string=re.sub(p,'',your_string)
这是正则表达式的用法,我觉得更有一般性

相关文章:

  • 2022-12-23
  • 2021-07-17
  • 2021-10-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2023-01-31
  • 2022-12-23
  • 2021-04-21
  • 2021-07-24
  • 2021-05-21
  • 2021-12-05
相关资源
相似解决方案