Function begins_with
Summary
#include "breeze/text/begins_with.hpp"
(1) bool begins_with(std::string const &s, std::string const &with) noexcept
(2) bool begins_with(std::string const &s, char c) noexcept
Function overload
Synopsis
#include "breeze/text/begins_with.hpp"
bool begins_with(std::string const &s, std::string const &with) noexcept
Description
- Returns
- Whether
s
begins withwith
. Ifwith
is empty, the result is alwaystrue
. - Note
- [FUTURE] C++20 will have
std::basic_string::starts_with()
andstd::basic_string_view::starts_with()
for this. - See
- ends_with().
Source
Line 38 in breeze/text/begins_with.hpp.
Synopsis
#include "breeze/text/begins_with.hpp"
bool begins_with(std::string const &s, char c) noexcept
Description
- Returns
true
if and only ifs
begins withc
; i.e. if and only if! s.empty() && s.front() == c
.
Source
Line 48 in breeze/text/begins_with.hpp.