MCPcopy Create free account
hub / github.com/chen3feng/toft / StripString

Function StripString

base/string/algorithm.cpp:105–113  ·  view source on GitHub ↗

Replaces any occurrence of the characters in 'remove' with the character 'replacewith'.

Source from the content-addressed store, hash-verified

103
104// Replaces any occurrence of the characters in 'remove' with the character 'replacewith'.
105void StripString(std::string* s, const char* remove, char replacewith)
106{
107 const char * str_start = s->c_str();
108 const char * str = str_start;
109 for (str = strpbrk(str, remove); str != NULL; str = strpbrk(str + 1, remove))
110 {
111 (*s)[str - str_start] = replacewith;
112 }
113}
114
115std::string StripString(const StringPiece& s, const char* remove, char replacewith)
116{

Callers

nothing calls this directly

Calls 1

as_stringMethod · 0.80

Tested by

no test coverage detected