replace all instances of victim with replacement
| 572 | |
| 573 | // replace all instances of victim with replacement |
| 574 | std::string mass_replace(const std::string &source, const std::string &victim, const std::string &replacement) |
| 575 | { |
| 576 | std::string answer = source; |
| 577 | std::string::size_type j = 0; |
| 578 | while ((j = answer.find(victim, j)) != std::string::npos ) |
| 579 | answer.replace(j, victim.length(), replacement); |
| 580 | return answer; |
| 581 | } |
| 582 | |
| 583 | #ifdef __WIN_DRIVER__ // this code tends to crash on SDL. |
| 584 | //http://www.codeproject.com/KB/string/UtfConverter.aspx |
no outgoing calls
no test coverage detected