首页 > 编程 > Python > 正文

编程:空格替换Python

2019-11-06 09:14:22
字体:
来源:转载
供稿:网友
# -*- 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);
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表