替换空格
class Solution {
public:
string replaceSpaces(string &str) {
string s;
for(int i = 0; i < str.size(); i++){
if(str[i] == ' '){
s += "%";
s += "20";
}else{
s += str[i];
}
}
return s;
}
};