# -*- coding:utf-8 -*-
class Replacement:
def replaceSpace(self, iniString, length):
#=================
# return iniString.replace(" ","%20")
#================
i = 0;
temp = list();
while i < length:
c = iniString[i];
if c == ' ':
temp.append('%20')
else:
temp.append(c)
i = i + 1;
return ''.join(temp);
编程:空格替换Python
最新推荐文章于 2024-07-15 02:18:21 发布