Corrade/Utility/String.h file

Namespace Corrade::Utility::String.

Contents

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.
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.
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.
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 string, in place.
void ltrimInPlace(std::string& string)
Trim leading whitespace from string.
void rtrimInPlace(std::string& string, const std::string& characters)
Trim trailing characters from string.
void rtrimInPlace(std::string& string)
Trim trailing whitespace from string.
void trimInPlace(std::string& string, const std::string& characters)
Trim leading and trailing characters from string.
void trimInPlace(std::string& string)
Trim leading and trailing whitespace from string.
auto split(const std::string& string, char delimiter) -> std::vector<std::string>
Split string on given character.
auto splitWithoutEmptyParts(const std::string& string, char delimiter) -> std::vector<std::string>
Split string on given character and remove empty parts.
auto splitWithoutEmptyParts(const std::string& string, const std::string& delimiters) -> std::vector<std::string>
Split string on any character from given set and remove empty parts.
auto splitWithoutEmptyParts(const std::string& string) -> std::vector<std::string>
Split string on whitespaces and remove empty parts.
auto join(const std::vector<std::string>& strings, char delimiter) -> std::string
Join strings with given character.
auto joinWithoutEmptyParts(const std::vector<std::string>& strings, char delimiter) -> std::string
Join strings with given character and remove empty parts.
auto lowercase(std::string string) -> std::string
Convert string to lowercase.
auto uppercase(std::string string) -> std::string
Convert string to uppercase.
auto beginsWith(const std::string& string, const std::string& prefix) -> bool
Whether the string has given prefix.
template<std::size_t size>
auto viewBeginsWith(Containers::ArrayView<const char> string, const char(&prefix)[size]) -> bool
Whether string view has given prefix.
auto endsWith(const std::string& string, const std::string& suffix) -> bool
Whether the string has given suffix.
template<std::size_t size>
auto viewEndsWith(Containers::ArrayView<const char> string, const char(&suffix)[size]) -> bool
Whether string view has given suffix.
auto stripPrefix(std::string string, const std::string& prefix) -> std::string
Strip given prefix from a string.
auto stripSuffix(std::string string, const std::string& suffix) -> std::string
Strip given suffix from a string.
auto replaceFirst(std::string string, const std::string& search, const std::string& replace) -> std::string
Replace first occurence in a string.
auto replaceAll(std::string string, const std::string& search, const std::string& replace) -> std::string
Replace all occurences in a string.