MCPcopy Create free account
hub / github.com/appdevforall/CodeOnTheGo / string_ends_with

Function string_ends_with

subprojects/llama.cpp/common/common.cpp:459–461  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

457}
458
459bool string_ends_with(const std::string_view & str, const std::string_view & suffix) {
460 return str.size() >= suffix.size() && str.compare(str.size()-suffix.size(), suffix.size(), suffix) == 0;
461}
462
463bool string_remove_suffix(std::string & str, const std::string_view & suffix) {
464 bool has_suffix = string_ends_with(str, suffix);

Calls 2

sizeMethod · 0.65
compareMethod · 0.45

Tested by

no test coverage detected