MCPcopy Create free account
hub / github.com/boostorg/json / ends_with

Method ends_with

include/boost/json/string.hpp:1453–1458  ·  view source on GitHub ↗

Check if the string ends with given suffix. @li **(1)** returns `true` if the string ends with `s`. @li **(2)** returns `true` if the string ends with the character `ch`. @par Complexity @li **(1)** linear in `s`. @li **(2)** constant. @par Exception Safety No-throw guarantee. @param s The string to check for. @{ */

Source from the content-addressed store, hash-verified

1451 @{
1452 */
1453 bool
1454 ends_with(string_view s) const noexcept
1455 {
1456 return size() >= s.size() &&
1457 subview(size() - s.size()) == s;
1458 }
1459
1460 /** Overload
1461 @param ch The character to check for.

Callers 1

testStartEndsWithMethod · 0.80

Calls 2

sizeFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected