我想从字符串中删除空格,但str.replace无法正常工作。请帮忙
1
s = "asd dsa asd "
string.replace(s, 'est', '')
NameError: name 'string' is not defined
2
s = "asd asd dsa "
str.replace(s, " ", "")
print s
Output: asd asd dsa
3
s = "asd asd dsa "
s.replace(" ", "")
print s
Output: asd asd dsa