题解 | #空格替换#
空格替换
http://www.nowcoder.com/practice/b0850698cb41449188344cdb647f3e99
public:
string replaceSpace(string iniString, int length) {
// write code here
string s="";
for(int i=0;i<length;i++){
if(iniString[i]==' ') s+="%20";
else s+=iniString[i];
}
return s;
}
};