MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / replaceInPlace

Function replaceInPlace

extlibs/catch/include/catch/catch.hpp:13206–13218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13204 }
13205
13206 bool replaceInPlace( std::string& str, std::string const& replaceThis, std::string const& withThis ) {
13207 bool replaced = false;
13208 std::size_t i = str.find( replaceThis );
13209 while( i != std::string::npos ) {
13210 replaced = true;
13211 str = str.substr( 0, i ) + withThis + str.substr( i+replaceThis.size() );
13212 if( i < str.size()-withThis.size() )
13213 i = str.find( replaceThis, i+withThis.size() );
13214 else
13215 i = std::string::npos;
13216 }
13217 return replaced;
13218 }
13219
13220 std::vector<StringRef> splitStringRef( StringRef str, char delimiter ) {
13221 std::vector<StringRef> subStrings;

Callers

nothing calls this directly

Calls 3

substrMethod · 0.80
findMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected