# -*- coding:utf-8 -*-
class Solution:
# array 二维列表
def replaceSpace(self, s):
# write code here
new = ""
flag = 0
for i in s:
if (i == " "):
new = s.replace(i,"%20")
flag = 1
if(flag == 0):
new = s
return new
sol = Solution()
print(sol.replaceSpace("hello world"))
剑指offer习题二
最新推荐文章于 2023-05-07 22:52:08 发布