我想从字符串,两端和单词之间消除所有空格.
我有这个Python代码:
def my_handle(self): sentence = ' hello apple ' sentence.strip()
但这只会消除字符串两边的空白.如何删除所有空格?
python trim removing-whitespace
python ×1
removing-whitespace ×1
trim ×1