替换空格

替换空格

http://www.nowcoder.com/questionTerminal/4060ac7e3e404ad1a894ef3e17650423

直接替换

    def replaceSpace(self, s):
        # write code here
        return s.replace(" ","%20")

正则表达式

import re
class Solution:
    def replaceSpace(self, s):
        # write code here
        s=re.sub(r" ","%20",s)
        return s
全部评论

相关推荐

Wy_m:只要不是能叫的上名的公司 去实习没有任何意义 不如好好沉淀自己
点赞 评论 收藏
分享
评论
25
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务