5 int replace(
string &
input,
const string&gone,
const string& it,
bool multiple) {
7 size_t i = input.find(gone,0);
8 while(i!=string::npos) {
10 input.replace(i,gone.size(),it);
11 i = input.find(gone,i+(multiple ? 0 : it.size()));
16 void strip(std::string &
input,
const std::string& blanks) {
17 size_t b = input.find_first_not_of(blanks);
18 if (b==std::string::npos) { input.clear();
return;}
19 size_t e = input.find_last_not_of(blanks);
20 input = input.substr(b,e-b+1);
25 size_t i = input.find(first,0);
26 while(i!=string::npos) {
27 size_t e = input.find(last,i);
28 if (e!=string::npos) {
30 input.replace(i,e+last.size()-
i,it);
31 i = input.find(first,i+(multiple ? 0 : it.size()));