| 846 | } |
| 847 | |
| 848 | void Str::replaceFirstWithEscape(base::type::string_t& str, const base::type::string_t& replaceWhat, |
| 849 | const base::type::string_t& replaceWith) { |
| 850 | std::size_t foundAt = base::type::string_t::npos; |
| 851 | while ((foundAt = str.find(replaceWhat, foundAt + 1)) != base::type::string_t::npos) { |
| 852 | if (foundAt > 0 && str[foundAt - 1] == base::consts::kFormatSpecifierChar) { |
| 853 | str.erase(foundAt > 0 ? foundAt - 1 : 0, 1); |
| 854 | ++foundAt; |
| 855 | } else { |
| 856 | str.replace(foundAt, replaceWhat.length(), replaceWith); |
| 857 | return; |
| 858 | } |
| 859 | } |
| 860 | } |
| 861 | #if defined(ELPP_UNICODE) |
| 862 | void Str::replaceFirstWithEscape(base::type::string_t& str, const base::type::string_t& replaceWhat, |
| 863 | const std::string& replaceWith) { |