filename
This commit is contained in:
15
src/string_utils.cpp
Normal file
15
src/string_utils.cpp
Normal file
@@ -0,0 +1,15 @@
|
||||
#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
|
Reference in New Issue
Block a user