word怎么去掉空格

word

1个回答

写回答

XyZ3327

2023-03-04 13:41

+ 关注

Word
Word

您可以使用strip()方法从字符串中去掉空格。

例如,

string_with_spaces="HelloWorld"

string_without_spaces=string_with_spaces.strip()

print(string_without_spaces)

以上代码将输出:"HelloWorld"

举报有用(17分享收藏

Copyright © 2025 IZhiDa.com All Rights Reserved.

知答 版权所有 粤ICP备2023042255号