剑指OFFER 替换空格
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()] = ' ';
return;
}
};