Use more starts_with/ends_with.

Remove ends_with global func.
This commit is contained in:
Nekotekina 2020-02-18 00:43:23 +03:00
parent 90f4023cb8
commit f08c778d2c
11 changed files with 24 additions and 30 deletions

View file

@ -25,12 +25,6 @@ inline void strcpy_trunc(char (&dst)[N], const char (&src)[N2])
std::memset(dst + count, 0, N - count);
}
template <std::size_t N>
inline bool ends_with(const std::string& src, const char (&end)[N])
{
return src.size() >= N - 1 && src.compare(src.size() - (N - 1), N - 1, end, N - 1) == 0;
}
namespace fmt
{
std::string replace_first(const std::string& src, const std::string& from, const std::string& to);