| 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; |