Function ends_with

Summary

#include "breeze/text/ends_with.hpp"

(1) bool ends_with(std::string const &s, std::string const &with) noexcept

(2) bool ends_with(std::string const &s, char c) noexcept

Function overload

Synopsis

#include "breeze/text/ends_with.hpp"

bool ends_with(std::string const &s, std::string const &with) noexcept

Description

Returns
Whether s ends with with. If with is empty, the result is always true.
Note
[FUTURE] C++20 will have std::basic_string::ends_with() and std::basic_string_view::ends_with() for this.
See
begins_with().

Source

Line 38 in breeze/text/ends_with.hpp.

Synopsis

#include "breeze/text/ends_with.hpp"

bool ends_with(std::string const &s, char c) noexcept

Description

Returns
true if and only if s ends with c, i.e. if and only if ! s.empty() && s.back() == c.

Source

Line 48 in breeze/text/ends_with.hpp.