| 135 | } |
| 136 | |
| 137 | bool endsWith(const std::string& string, const std::string& search) |
| 138 | { |
| 139 | if (string.size() < search.size()) |
| 140 | { |
| 141 | return false; |
| 142 | } |
| 143 | return (std::mismatch(search.rbegin(), search.rend(), string.rbegin()).first |
| 144 | == search.rend()); |
| 145 | } |
| 146 | |
| 147 | std::size_t distance(std::string_view source, std::string_view target) |
| 148 | { |