| 223 | } |
| 224 | |
| 225 | tstring SU::ReplaceString(const tstring & source, const tstring & find, const tstring & replace) { |
| 226 | tstring result(source); |
| 227 | size_t findlen = find.length(); |
| 228 | size_t replacelen = replace.length(); |
| 229 | |
| 230 | tstring::size_type pos = 0; |
| 231 | while( (pos = result.find(find, pos)) != tstring::npos ) { |
| 232 | result.erase(pos, findlen); |
| 233 | result.insert(pos, replace); |
| 234 | pos += replacelen; |
| 235 | } |
| 236 | |
| 237 | return result; |
| 238 | } |
| 239 | |
| 240 | #ifdef UNICODE |
| 241 | #define _vsntprintf _vsnwprintf |