MCPcopy Create free account
hub / github.com/RcppCore/Rcpp / endsWith

Function endsWith

src/attributes.cpp:3107–3111  ·  view source on GitHub ↗

does a string end with another string?

Source from the content-addressed store, hash-verified

3105
3106 // does a string end with another string?
3107 bool endsWith(const std::string& str, const std::string& suffix)
3108 {
3109 return str.size() >= suffix.size() &&
3110 str.compare(str.size() - suffix.size(), suffix.size(), suffix) == 0;
3111 }
3112
3113 // show a warning message
3114 void showWarning(const std::string& msg) { // #nocov start

Callers 1

compileAttributesFunction · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected