class Solution:
def replaceSpace(self , s ):
temp=s.split(" ")
res=temp[0]
for i in temp[1:len(temp)]:
res=res+"%20"+i
return res
s=Solution()
word="We Are Happy"
res=s.replaceSpace(word)
print(res)
替换空格——python
最新推荐文章于 2024-02-02 13:07:00 发布