string::ends_with
Check if the string ends with given suffix.
Synopsis
bool
ends_with(
string_view s) const noexcept; (1)
bool
ends_with(
char ch) const noexcept; (2)
Description
-
(1) returns
true
if the string ends withs
. -
(2) returns
true
if the string ends with the characterch
.
Complexity
-
(1) linear in
s
. -
(2) constant.
Exception Safety
No-throw guarantee.
Parameters
Name | Description |
---|---|
|
The string to check for. |
|
The character to check for. |