diff --git a/src/Utils/String.cpp b/src/Utils/String.cpp index ad314e39..568629b1 100644 --- a/src/Utils/String.cpp +++ b/src/Utils/String.cpp @@ -35,11 +35,6 @@ namespace Utils return input; } - bool EndsWith(std::string haystack, std::string needle) - { - return (strstr(haystack.data(), needle.data()) == (haystack.data() + haystack.size() - needle.size())); - } - std::string DumpHex(std::string data, std::string separator) { std::string result; @@ -104,6 +99,11 @@ namespace Utils return (haystack.size() >= needle.size() && !strncmp(needle.data(), haystack.data(), needle.size())); } + bool EndsWith(std::string haystack, std::string needle) + { + return (haystack.size() >= needle.size() && !strncmp(needle.data(), haystack.data() + (haystack.size() - needle.size()), needle.size())); + } + int IsSpace(int c) { if (c < -1) return 0;