题目描述:
请实现一个函数,将一个字符串中的每个空格替换成“%20”。例如,当字符串为We Are Happy.则经过替换之后的字符串为We%20Are%20Happy。
code:
# -*- coding:utf-8 -*-
class Solution:
# s 源字符串
def replaceSpace(self, s):
# write code here
s = s.replace(" ", "%20")
return s
&spm=1001.2101.3001.5002&articleId=88253693&d=1&t=3&u=93c6575f73da4dab884059f89af0dc6f)
3559

被折叠的 条评论
为什么被折叠?



