| 172 | } |
| 173 | |
| 174 | std::string replace( std::string target, std::string_view from, std::string_view to ) |
| 175 | { |
| 176 | std::string ret; |
| 177 | bool first = true; |
| 178 | split( target, from, [&]( std::string_view segment ) |
| 179 | { |
| 180 | if ( first ) |
| 181 | first = false; |
| 182 | else |
| 183 | ret += to; |
| 184 | ret += segment; |
| 185 | return false; |
| 186 | } ); |
| 187 | return ret; |
| 188 | } |
| 189 | |
| 190 | void replaceInplace( std::string& target, std::string_view from, std::string_view to ) |
| 191 | { |
no test coverage detected