Corrade/Utility/String.h file

Namespace Corrade::Utility::String.

Namespaces

namespace Corrade
Root namespace.
namespace Corrade::Utility
Utitlities.
namespace Corrade::Utility::String
String utilities.

Functions

auto fromArray(const char* string) -> std::string
Safely construct string from char array.
auto fromArray(const char* string, std::size_t length) -> std::string
Safely construct string from char array with explicit length.
auto ltrim(std::string string, const std::string& characters) -> std::string
Trim leading characters from string.
template<std::size_t size>
auto ltrim(std::string string, const char(&characters)[size]) -> std::string
auto ltrim(std::string string) -> std::string
Trim leading whitespace from string.
auto rtrim(std::string string, const std::string& characters) -> std::string
Trim trailing characters from string.
template<std::size_t size>
auto rtrim(std::string string, const char(&characters)[size]) -> std::string
auto rtrim(std::string string) -> std::string
Trim trailing whitespace from string.
auto trim(std::string string, const std::string& characters) -> std::string
Trim leading and trailing characters from string.
template<std::size_t size>
auto trim(std::string string, const char(&characters)[size]) -> std::string
auto trim(std::string string) -> std::string
Trim leading and trailing whitespace from string.
void ltrimInPlace(std::string& string, const std::string& characters)
Trim leading characters from a string, in place.
template<std::size_t size>
void ltrimInPlace(std::string& string, const char(&characters)[size])
void ltrimInPlace(std::string& string)
Trim leading whitespace from a string, in place.
void rtrimInPlace(std::string& string, const std::string& characters)
Trim trailing characters from a string, in place.
template<std::size_t size>
void rtrimInPlace(std::string& string, const char(&characters)[size])
void rtrimInPlace(std::string& string)
Trim trailing whitespace from a string, in place.
void trimInPlace(std::string& string, const std::string& characters)
Trim leading and trailing characters from a string, in place.
template<std::size_t size>
void trimInPlace(std::string& string, const char(&characters)[size])
void trimInPlace(std::string& string)
Trim leading and trailing whitespace from a string, in place.
auto split(const std::string& string, char delimiter) -> std::vector<std::string>
Split a string on given character.
auto split(Containers::StringView string, char delimiter) -> Containers::Array<Containers::StringView> deprecated in Git master
auto splitWithoutEmptyParts(const std::string& string, char delimiter) -> std::vector<std::string>
Split a string on given character and remove empty parts.
auto splitWithoutEmptyParts(Containers::StringView string, char delimiter) -> Containers::Array<Containers::StringView> deprecated in Git master
auto splitWithoutEmptyParts(const std::string& string, const std::string& delimiters) -> std::vector<std::string>
Split a string on any character from given set and remove empty parts.
auto splitWithoutEmptyParts(Containers::StringView string, Containers::StringView delimiters) -> Containers::Array<Containers::StringView> deprecated in Git master
auto splitWithoutEmptyParts(const std::string& string) -> std::vector<std::string>
Split a string on whitespace and remove empty parts.
auto splitWithoutEmptyParts(const Containers::StringView string) -> Containers::Array<Containers::StringView> deprecated in Git master
auto partition(const std::string& string, char separator) -> Containers::StaticArray<3, std::string> new in 2019.10
Partition a string.
auto partition(const std::string& string, const std::string& separator) -> Containers::StaticArray<3, std::string> new in 2019.10
auto rpartition(const std::string& string, char separator) -> Containers::StaticArray<3, std::string> new in 2019.10
Right-partition a string.
auto rpartition(const std::string& string, const std::string& separator) -> Containers::StaticArray<3, std::string> new in 2019.10
auto join(const std::vector<std::string>& strings, char delimiter) -> std::string
Join strings with given character.
template<std::size_t size>
auto join(const std::vector<std::string>& strings, const char(&delimiter)[size]) -> std::string new in 2019.10
auto join(const std::vector<std::string>& strings, const std::string& delimiter) -> std::string new in 2019.10
auto joinWithoutEmptyParts(const std::vector<std::string>& strings, char delimiter) -> std::string
Join strings with given character and remove empty parts.
template<std::size_t size>
auto joinWithoutEmptyParts(const std::vector<std::string>& strings, const char(&delimiter)[size]) -> std::string
auto joinWithoutEmptyParts(const std::vector<std::string>& strings, const std::string& delimiter) -> std::string
void lowercaseInPlace(Containers::MutableStringView string) new in Git master
Convert ASCII characters in a string to lowercase, in place.
auto lowercase(Containers::StringView string) -> Containers::String new in Git master
Convert ASCII characters in a string to lowercase.
auto lowercase(Containers::String string) -> Containers::String new in Git master
auto lowercase(std::string string) -> std::string
void uppercaseInPlace(Containers::MutableStringView string) new in Git master
Convert ASCII characters in a string to uppercase, in place.
auto uppercase(Containers::StringView string) -> Containers::String new in Git master
Convert ASCII characters in a string to uppercase, in place.
auto uppercase(Containers::String string) -> Containers::String new in Git master
auto uppercase(std::string string) -> std::string
auto beginsWith(const std::string& string, const std::string& prefix) -> bool
Whether the string has given prefix.
template<std::size_t size>
auto beginsWith(const std::string& string, const char(&prefix)[size]) -> bool
auto beginsWith(const std::string& string, char prefix) -> bool
template<std::size_t size>
auto viewBeginsWith(Containers::ArrayView<const char> string, const char(&prefix)[size]) -> bool deprecated in Git master
Whether string view has given prefix.
auto viewBeginsWith(Containers::ArrayView<const char> string, char prefix) -> bool deprecated in Git master
auto endsWith(const std::string& string, const std::string& suffix) -> bool
Whether the string has given suffix.
template<std::size_t size>
auto endsWith(const std::string& string, const char(&suffix)[size]) -> bool
auto endsWith(const std::string& string, char suffix) -> bool
template<std::size_t size>
auto viewEndsWith(Containers::ArrayView<const char> string, const char(&suffix)[size]) -> bool deprecated in Git master
Whether string view has given suffix.
auto viewEndsWith(Containers::ArrayView<const char> string, char suffix) -> bool deprecated in Git master
auto stripPrefix(std::string string, const std::string& prefix) -> std::string
Strip given prefix from a string.
template<std::size_t size>
auto stripPrefix(std::string string, const char(&prefix)[size]) -> std::string
auto stripPrefix(std::string string, char prefix) -> std::string
auto stripSuffix(std::string string, const std::string& suffix) -> std::string
Strip given suffix from a string.
template<std::size_t size>
auto stripSuffix(std::string string, const char(&suffix)[size]) -> std::string
auto stripSuffix(std::string string, char suffix) -> std::string
auto replaceFirst(std::string string, const std::string& search, const std::string& replace) -> std::string
Replace first occurrence in a string.
template<std::size_t searchSize, std::size_t replaceSize>
auto replaceFirst(std::string string, const char(&search)[searchSize], const char(&replace)[replaceSize]) -> std::string
template<std::size_t searchSize>
auto replaceFirst(std::string string, const char(&search)[searchSize], const std::string& replace) -> std::string
template<std::size_t replaceSize>
auto replaceFirst(std::string string, const std::string& search, const char(&replace)[replaceSize]) -> std::string
auto replaceAll(std::string string, const std::string& search, const std::string& replace) -> std::string
Replace all occurrences in a string.
template<std::size_t searchSize, std::size_t replaceSize>
auto replaceAll(std::string string, const char(&search)[searchSize], const char(&replace)[replaceSize]) -> std::string
template<std::size_t searchSize>
auto replaceAll(std::string string, const char(&search)[searchSize], const std::string& replace) -> std::string
template<std::size_t replaceSize>
auto replaceAll(std::string string, const std::string& search, const char(&replace)[replaceSize]) -> std::string
auto parseNumberSequence(Containers::StringView string, std::uint32_t min, std::uint32_t max) -> Containers::Optional<Containers::Array<std::uint32_t>> new in Git master
Parse a number sequence.