MCPcopy Create free account
hub / github.com/bbuchfink/diamond / replace

Function replace

src/util/string/string.cpp:63–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61namespace Util { namespace String {
62
63string replace(const string& s, char a, char b) {
64 string r = s;
65 size_t i = r.find_first_of(a);
66 while (i != string::npos) {
67 r[i++] = b;
68 i = r.find_first_of(a, i);
69 }
70 return r;
71}
72
73std::string ratio_percentage(const double x, const double y) {
74 stringstream ss;

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected