xieite::tolower()

Defined in header <xieite/data/tolower.hpp>

Converts every character of a string (or a single character) to lowercase.
Only handles the English alphabet.


Declarations

#0
template<xieite::is_ch Char>
[[nodiscard]] constexpr Char tolower(Char c) noexcept;
Makes a single character lowercase. Internally uses a lookup table.

#1
template<typename Char, typename Traits = std::char_traits<Char>, typename Alloc = std::allocator<Char>>
[[nodiscard]] constexpr std::basic_string<Char, Traits, Alloc> tolower(std::basic_string_view<Char, Traits> strv, Alloc&& alloc = {}) noexcept(false);
Makes an entire string lowercase. Internally calls #0.

#2
template<typename Char, typename Traits = std::char_traits<Char>, typename Alloc = std::allocator<Char>>
[[nodiscard]] constexpr auto tolower(const std::basic_string<Char, Traits, Alloc>& str, Alloc&& alloc = {})
	XIEITE_ARROW(xieite::tolower(xieite::str_view(str), XIEITE_FWD(alloc)))
Defers to #1 after deducing Char, Traits, and Alloc.

#3
template<xieite::is_ch Char, typename Traits = std::char_traits<Char>, typename Alloc = std::allocator<Char>, std::size_t length>
[[nodiscard]] constexpr auto tolower(const xieite::group<Char[length]>& str, Alloc&& alloc = {})
	XIEITE_ARROW(xieite::tolower(xieite::str_view<Char, Traits>(str), XIEITE_FWD(alloc)))
Defers to #1 after deducing Char and possibly Alloc.


Example

int main() {
	xieite::dump(xieite::tolower("HeLlO, wOrLd!"));
}
Output:
hello, world!
[View in Compiler Explorer]