muu/strings.h file

Functions to simplify working with strings.

Namespaces

namespace muu
The root namespace for all muu functions and types.

Functions

template <typename Char>
auto transcode(std::string_view str) noexcept -> std::conditional_t< std::is_same_v< Char, char >, std::string_view, std::basic_string< Char >> -> auto
Transcodes a UTF-8 string into another UTF encoding.
template <typename Char>
auto transcode(std::wstring_view str) noexcept -> std::conditional_t< std::is_same_v< Char, wchar_t >, std::wstring_view, std::basic_string< Char >> -> auto
Transcodes a UTF wide string into another UTF encoding.
template <typename Char>
auto transcode(std::u16string_view str) noexcept -> std::conditional_t< std::is_same_v< Char, char16_t >, std::u16string_view, std::basic_string< Char >> -> auto
Transcodes a UTF-16 string into another UTF encoding.
template <typename Char>
auto transcode(std::u32string_view str) noexcept -> std::conditional_t< std::is_same_v< Char, char32_t >, std::u32string_view, std::basic_string< Char >> -> auto
Transcodes a UTF-32 string into another UTF encoding.
template <typename Char>
auto transcode(std::u8string_view str) noexcept -> std::conditional_t< std::is_same_v< Char, char8_t >, std::u8string_view, std::basic_string< Char >> -> auto
Transcodes a UTF-8 string into another UTF encoding.
auto trim(std::string_view str) -> std::string_view constexpr noexcept
Trims whitespace from both ends of a UTF-8 string.
auto trim(std::wstring_view str) -> std::wstring_view constexpr noexcept
Trims whitespace from both ends of a UTF wide string.
auto trim(std::u16string_view str) -> std::u16string_view constexpr noexcept
Trims whitespace from both ends of a UTF-16 string.
auto trim(std::u32string_view str) -> std::u32string_view constexpr noexcept
Trims whitespace from both ends of a UTF-32 string.
auto trim(std::u8string_view str) -> std::u8string_view constexpr noexcept
Trims whitespace from both ends of a UTF-8 string.
auto trim_left(std::string_view str) -> std::string_view constexpr noexcept
Trims whitespace from the left end of a UTF-8 string.
auto trim_left(std::wstring_view str) -> std::wstring_view constexpr noexcept
Trims whitespace from the left end of a UTF wide string.
auto trim_left(std::u16string_view str) -> std::u16string_view constexpr noexcept
Trims whitespace from the left end of a UTF-16 string.
auto trim_left(std::u32string_view str) -> std::u32string_view constexpr noexcept
Trims whitespace from the left end of a UTF-32 string.
auto trim_left(std::u8string_view str) -> std::u8string_view constexpr noexcept
Trims whitespace from the left end of a UTF-8 string.
auto trim_right(std::string_view str) -> std::string_view constexpr noexcept
Trims whitespace from the right end of a UTF-8 string.
auto trim_right(std::wstring_view str) -> std::wstring_view constexpr noexcept
Trims whitespace from the right end of a UTF wide string.
auto trim_right(std::u16string_view str) -> std::u16string_view constexpr noexcept
Trims whitespace from the right end of a UTF-16 string.
auto trim_right(std::u32string_view str) -> std::u32string_view constexpr noexcept
Trims whitespace from the right end of a UTF-32 string.
auto trim_right(std::u8string_view str) -> std::u8string_view constexpr noexcept
Trims whitespace from the right end of a UTF-8 string.