1 #ifndef STAN_LANG_AST_FUN_ENDS_WITH_DEF_HPP 2 #define STAN_LANG_AST_FUN_ENDS_WITH_DEF_HPP 10 bool ends_with(
const std::string& suffix,
const std::string& s) {
11 size_t idx = s.rfind(suffix);
12 return idx != std::string::npos && idx == (s.size() - suffix.size());
Probability, optimization and sampling library.
bool ends_with(const std::string &suffix, const std::string &s)
Returns true if the specified suffix appears at the end of the specified string.
AST variant structure for indexes, holding any of a unary, multi, omni, lower-bound, upper-bound, or lower- and upper-bound index.