MCPcopy Create free account
hub / github.com/ChaiScript/ChaiScript / endsWith

Function endsWith

unittests/catch.hpp:9579–9581  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9577 return !s.empty() && s[0] == prefix;
9578 }
9579 bool endsWith( std::string const& s, std::string const& suffix ) {
9580 return s.size() >= suffix.size() && std::equal(suffix.rbegin(), suffix.rend(), s.rbegin());
9581 }
9582 bool endsWith( std::string const& s, char suffix ) {
9583 return !s.empty() && s[s.size()-1] == suffix;
9584 }

Callers 4

matchMethod · 0.85
addMethod · 0.85
WildcardPatternMethod · 0.85
matchesMethod · 0.85

Calls 3

equalFunction · 0.85
sizeMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected