标签:oid int off 替换 cpp while return public length
class Solution {
public:
void replaceSpace(char *str,int length) {
string s(str);
size_t pos;
while( (pos = s.find(' ')) != string::npos )
{
s.replace(pos,1,"%20");
}
for(int i=0;i<s.size();i++)
{
str[i]=s[i];
}
str[s.size()] = '\0';
return;
}
};
标签:oid int off 替换 cpp while return public length
原文地址:https://www.cnblogs.com/virgildevil/p/12204096.html