Files
simple-object-server/src/string_utils.cpp
Your Name 3c5fc11065 filename
2025-05-03 11:15:12 +12:00

15 lines
422 B
C++

#include "string_utils.hpp"
namespace simple_object_storage {
namespace utils {
bool ends_with(const std::string& value, const std::string& suffix) {
if (suffix.length() > value.length()) {
return false;
}
// Use rfind to check if the suffix matches the end of the value
return value.rfind(suffix) == value.length() - suffix.length();
}
} // namespace utils
} // namespace simple_object_storage