bsl::basic_string::ends_with

Return whether this string ends with the specified sequence.

Synopsis

Declared in <bslstl_string.h>

bool
ends_with(basic_string_view<CHAR_TYPE, CHAR_TRAITS> characterString) const noexcept;

Description

Return true if the length of this string is equal to or greater than the length of the specified characterString and the last characterString.length() characters of this string are equal to the characters of the characterString, and false otherwise. CHAR_TRAITS::compare is used to compare characters. See {Lexicographical Comparisons}.

Return Value

true if this string ends with the sequence, otherwise false

Parameters

NameDescription
characterStringpointer to characters