MCPcopy Create free account
hub / github.com/ashkulz/NppFTP / ReplaceString

Method ReplaceString

src/StringUtils.cpp:225–238  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

223}
224
225tstring 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

Callers

nothing calls this directly

Calls 2

lengthMethod · 0.80
findMethod · 0.80

Tested by

no test coverage detected