General Utility Library for C++14
2.12
|
Checking whether a string contains, ends with, or starts with another string.
Functions | |
constexpr bool | gul14::contains (string_view haystack, string_view needle) noexcept |
Determine whether a string contains another string. More... | |
constexpr bool | gul14::contains (string_view haystack, char needle) noexcept |
Determine whether a string contains a certain character. More... | |
constexpr bool | gul14::ends_with (string_view str, string_view suffix) noexcept |
Determine whether a string ends with another string. More... | |
constexpr bool | gul14::ends_with (string_view str, char c) noexcept |
Determine whether a string ends with a certain character. More... | |
constexpr bool | gul14::starts_with (string_view str, string_view prefix) noexcept |
Determine whether a string starts with another string. More... | |
constexpr bool | gul14::starts_with (string_view str, char c) noexcept |
Determine whether a string starts with a certain character. More... | |
constexpr bool | gul14::equals_nocase (string_view str1, string_view str2) noexcept |
Determine whether a string is equal to another one, making no distinction between upper and lower case ASCII characters. More... | |
constexpr bool | gul14::contains_nocase (string_view haystack, string_view needle) noexcept |
Determine whether a string contains another string. More... | |
constexpr bool | gul14::contains_nocase (string_view haystack, char needle) noexcept |
Determine whether a string contains a certain character. More... | |
constexpr bool | gul14::ends_with_nocase (string_view str, string_view suffix) noexcept |
Determine whether a string ends with another string. More... | |
constexpr bool | gul14::ends_with_nocase (string_view str, char c) noexcept |
Determine whether a string ends with a certain character. More... | |
constexpr bool | gul14::starts_with_nocase (string_view str, string_view prefix) noexcept |
Determine whether a string starts with another string. More... | |
constexpr bool | gul14::starts_with_nocase (string_view str, char c) noexcept |
Determine whether a string starts with a certain character. More... | |
|
inlineconstexprnoexcept |
Determine whether a string contains a certain character.
The comparison is case sensitive.
haystack | The string in which to search. |
needle | The character that should be searched for. |
haystack
contains at least one occurrence of needle
, false otherwise.
|
inlineconstexprnoexcept |
Determine whether a string contains another string.
The comparison is case sensitive. If the searched-for string is empty, the result is true.
haystack | The string in which to search. |
needle | The string that should be searched for. |
haystack
contains at least one occurrence of needle
, false otherwise.
|
inlineconstexprnoexcept |
Determine whether a string contains a certain character.
The comparison is case insensitive as far as ASCII characters are concerned (C locale).
haystack | The string in which to search. |
needle | The character that should be searched for. |
haystack
contains at least one occurrence of needle
, false otherwise.References gul14::lowercase_ascii().
|
inlineconstexprnoexcept |
Determine whether a string contains another string.
The comparison is case insensitive as far as ASCII characters are concerned (C locale). If the searched-for string is empty, the result is true.
haystack | The string in which to search. |
needle | The string that should be searched for. |
haystack
contains at least one occurrence of needle
, false otherwise.References gul14::lowercase_ascii().
|
inlineconstexprnoexcept |
Determine whether a string ends with a certain character.
The comparison is case sensitive.
str | The string to be tested. |
c | The character to be looked for at the end of str . |
str
ends with c
, false otherwise.
|
inlineconstexprnoexcept |
Determine whether a string ends with another string.
The comparison is case sensitive. If the searched-for suffix is empty, the result is true.
str | The full string to be tested. |
suffix | The suffix to be looked for at the end of str . |
str
ends with suffix
, false otherwise.
|
inlineconstexprnoexcept |
Determine whether a string ends with a certain character.
The comparison is case insensitive as far as ASCII characters are concerned (C locale).
str | The string to be tested. |
c | The character to be looked for at the end of str . |
str
ends with c
, false otherwise.References gul14::lowercase_ascii().
|
inlineconstexprnoexcept |
Determine whether a string ends with another string.
The comparison is case insensitive as far as ASCII characters are concerned (C locale). If the searched-for suffix is empty, the result is true.
str | The full string to be tested. |
suffix | The suffix to be looked for at the end of str . |
str
ends with suffix
, false otherwise.References gul14::lowercase_ascii().
|
inlineconstexprnoexcept |
Determine whether a string is equal to another one, making no distinction between upper and lower case ASCII characters.
In other terms, this function performs a case insensitive string comparison using the C locale.
str1,str2 | The two strings that should be compared. |
str1
and str2
are equal, or false otherwise.References gul14::lowercase_ascii().
|
inlineconstexprnoexcept |
Determine whether a string starts with a certain character.
The comparison is case sensitive.
str | The string to be tested. |
c | The character to be looked for at the beginning of str . |
str
starts with c
, false otherwise.
|
inlineconstexprnoexcept |
Determine whether a string starts with another string.
The comparison is case sensitive. If the searched-for prefix is empty, the result is true.
str | The full string to be tested. |
prefix | The prefix to be looked for at the beginning of str . |
str
starts with prefix
, false otherwise.
|
inlineconstexprnoexcept |
Determine whether a string starts with a certain character.
The comparison is case insensitive as far as ASCII characters are concerned (C locale).
str | The string to be tested. |
c | The character to be looked for at the beginning of str . |
str
starts with c
, false otherwise.References gul14::lowercase_ascii().
|
inlineconstexprnoexcept |
Determine whether a string starts with another string.
The comparison is case insensitive as far as ASCII characters are concerned (C locale). If the searched-for prefix is empty, the result is true.
str | The full string to be tested. |
prefix | The prefix to be looked for at the beginning of str . |
str
starts with prefix
, false otherwise.References gul14::lowercase_ascii().