.. index:: pair: class; EE::String .. _doxid-class_e_e_1_1_string: class EE::String ================ .. toctree:: :hidden: class_EE_String_BMH.rst Overview ~~~~~~~~ Utility string class that automatically handles conversions between types and encodings :ref:`EE::String ` is a utility string class defined mainly for convenience. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include class String { public: // typedefs typedef char32_t :target:`StringBaseType`; typedef std::basic_string<:ref:`StringBaseType`> :target:`StringType`; typedef StringType::iterator :target:`Iterator`; typedef StringType::const_iterator :ref:`ConstIterator`; typedef StringType::reverse_iterator :ref:`ReverseIterator`; typedef StringType::const_reverse_iterator :ref:`ConstReverseIterator`; typedef :ref:`Uint32` :ref:`HashType`; typedef std::basic_string_view<:ref:`StringBaseType`> :target:`View`; // classes class :ref:`BMH`; // fields static const std::size_t :ref:`InvalidPos`; // construction :ref:`String`(); :ref:`String`(char ansiChar); :ref:`String`(wchar_t wideChar); :ref:`String`(:ref:`StringBaseType` utf32Char); :ref:`String`(const char* utf8String); :ref:`String`(const char* utf8String, const size_t& utf8StringSize); :ref:`String`(const std::string& utf8String); :ref:`String`(const std::basic_string& utf8String); :ref:`String`(const std::string_view& utf8String); :ref:`String`(const wchar_t* wideString); :ref:`String`(const std::wstring& wideString); :ref:`String`(const :ref:`StringBaseType`* utf32String); :ref:`String`(const :ref:`StringType`& utf32String); :ref:`String`(const String& str); :ref:`String`(const :ref:`String::View`& str); // methods static constexpr :ref:`HashType` :ref:`hash`(const char* str); static constexpr :ref:`String::HashType` :target:`hash`(const char* str, :ref:`Int64` len); static String :ref:`escape`(const String& str); static String :ref:`unescape`(const String& str); static :ref:`String::HashType` :ref:`hash`(const std::string& str); static :ref:`String::HashType` :ref:`hash`(const std::string_view& str); static :ref:`String::HashType` :ref:`hash`(const String& str); static bool :ref:`isCharacter`(const int& value); static bool :ref:`isNumber`(const int& value, bool AllowDot = false); static bool :ref:`isNumber`(const std::string& value, bool AllowDot = false); static bool :ref:`isLetter`(const int& value); static bool :ref:`isAlphaNum`(const int& value); static bool :ref:`isHexNotation`(const std::string& value, const std::string& withPrefix = ""); static bool :ref:`isWholeWord`(const std::string& haystack, const std::string& needle, const :ref:`Int64`& startPos); static bool :ref:`isWholeWord`(const String& haystack, const String& needle, const :ref:`Int64`& startPos); static std::vector :ref:`split`(const String& str, const :ref:`StringBaseType`& delim = '\n', const bool& pushEmptyString = false, const bool& keepDelim = false); static std::vector :ref:`split`(const std::string& str, const :ref:`Int8`& delim = '\n', const bool& pushEmptyString = false, const bool& keepDelim = false); static std::vector :ref:`split`(const std::string_view& str, const :ref:`Int8`& delim = '\n', const bool& pushEmptyString = false); static std::vector :ref:`split`(const std::string& str, const std::string& delims, const std::string& delimsPreserve = "", const std::string& quote = "\"", const bool& removeQuotes = false); static void :ref:`splitCb`(std::function fnCb, const std::string& str, const std::string& delims, const std::string& delimsPreserve = "", const std::string& quote = "\"", const bool& removeQuotes = false); static std::string :ref:`join`(const std::vector& strArray, const :ref:`Int8`& joinchar = ' ', const bool& appendLastJoinChar = false); static String :ref:`join`(const std::vector& strArray, const :ref:`Int8`& joinchar = ' ', const bool& appendLastJoinChar = false); static std::string :target:`join`(const std::vector& strArray, const :ref:`Int8`& joinchar = ' ', const bool& appendLastJoinChar = false); static std::string :ref:`lTrim`(const std::string& str, char character = ' '); static std::string :ref:`rTrim`(const std::string& str, char character = ' '); static std::string :ref:`trim`(const std::string& str, char character = ' '); static std::string_view :ref:`lTrim`(const std::string_view& str, char character = ' '); static std::string_view :ref:`rTrim`(const std::string_view& str, char character = ' '); static std::string_view :ref:`trim`(const std::string_view& str, char character = ' '); static :ref:`String::View` :ref:`lTrim`(const :ref:`String::View`& str, char character = ' '); static :ref:`String::View` :ref:`rTrim`(const :ref:`String::View`& str, char character = ' '); static :ref:`String::View` :ref:`trim`(const :ref:`String::View`& str, char character = ' '); static void :ref:`trimInPlace`(std::string& str, char character = ' '); static String :ref:`lTrim`(const String& str, char character = ' '); static String :ref:`rTrim`(const String& str, char character = ' '); static String :ref:`trim`(const String& str, char character = ' '); static void :ref:`trimInPlace`(String& str, char character = ' '); static std::string :ref:`lTrim`(const std::string& str, std::string_view characters); static std::string :ref:`rTrim`(const std::string& str, std::string_view characters); static std::string :ref:`trim`(const std::string& str, std::string_view characters); static std::string_view :ref:`lTrim`(const std::string_view& str, std::string_view characters); static std::string_view :ref:`rTrim`(const std::string_view& str, std::string_view characters); static std::string_view :ref:`trim`(const std::string_view& str, std::string_view characters); static :ref:`String::View` :ref:`lTrim`(const :ref:`String::View`& str, :ref:`String::View` characters); static :ref:`String::View` :ref:`rTrim`(const :ref:`String::View`& str, :ref:`String::View` characters); static :ref:`String::View` :ref:`trim`(const :ref:`String::View`& str, :ref:`String::View` characters); static void :ref:`trimInPlace`(std::string& str, std::string_view characters); static String :ref:`lTrim`(const String& str, std::string_view characters); static String :ref:`rTrim`(const String& str, std::string_view characters); static String :ref:`trim`(const String& str, std::string_view characters); static void :ref:`trimInPlace`(String& str, std::string_view characters); static void :ref:`toUpperInPlace`(std::string& str); static std::string :ref:`toUpper`(std::string str); static void :ref:`toLowerInPlace`(std::string& str); static void :ref:`capitalizeInPlace`(std::string& str); static std::string :ref:`toLower`(std::string str); static std::string :ref:`capitalize`(std::string str); static String :ref:`toUpper`(const String& str); static String :ref:`toLower`(const String& str); static String :ref:`capitalize`(const String& str); static std::vector<:ref:`Uint8`> :ref:`stringToUint8`(const std::string& str); static std::string :ref:`Uint8ToString`(const std::vector<:ref:`Uint8`>& v); static void :ref:`insertChar`(String& str, const unsigned int& pos, const :ref:`StringBaseType`& tchar); static void :ref:`strCopy`(char* Dst, const char* Src, unsigned int DstSize); static bool :ref:`startsWith`(const std::string& haystack, const std::string& needle); static bool :ref:`startsWith`(const String& haystack, const String& needle); static bool :ref:`startsWith`(const char* haystack, const char* needle); static bool :ref:`startsWith`(std::string_view haystack, std::string_view needle); static bool :ref:`endsWith`(const std::string& haystack, const std::string& needle); static bool :ref:`endsWith`(const String& haystack, const String& needle); static bool :ref:`contains`(const std::string& haystack, const std::string& needle); static bool :ref:`contains`(const String& haystack, const String& needle); static bool :ref:`contains`(std::string_view haystack, std::string_view needle); static bool :ref:`icontains`(const std::string& haystack, const std::string& needle); static bool :ref:`icontains`(const String& haystack, const String& needle); static bool :ref:`icontains`(std::string_view haystack, std::string_view needle); static int :target:`fuzzyMatchSimple`(const std::string& pattern, const std::string& string, bool allowUneven = false, bool permissive = false); static int :target:`fuzzyMatch`(const std::string& pattern, const std::string& string); static void :ref:`replaceAll`(std::string& target, const std::string& that, const std::string& with); static void :ref:`replaceAll`(String& target, const String& that, const String& with); static void :ref:`replace`(std::string& target, const std::string& that, const std::string& with); static void :ref:`replace`(String& target, const String& that, const String& with); static std::string :ref:`removeNumbersAtEnd`(std::string txt); static std::string_view :ref:`numberClean`(std::string_view strNumber); static std::string :ref:`numberClean`(const std::string& strNumber); static void :ref:`numberCleanInPlace`(std::string& strNumber); static std::size_t :ref:`findCloseBracket`(const std::string& string, std::size_t startOffset, char openBracket, char closeBracket); static int :ref:`valueIndex`(const std::string& val, const std::string& strings, int defValue = -1, char delim = ';'); static bool :target:`iequals`(std::string_view str1, std::string_view str2); static bool :target:`iequals`(:ref:`String::View` str1, :ref:`String::View` str2); static std::string :ref:`randString`(size_t len, std::string dictionary = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"); static std::string :ref:`toString`(const :ref:`Int8`& i); static std::string :target:`toString`(const :ref:`Int16`& i); static std::string :target:`toString`(const :ref:`Int32`& i); static std::string :target:`toString`(const :ref:`Int64`& i); static std::string :target:`toString`(const :ref:`Uint8`& i); static std::string :target:`toString`(const :ref:`Uint16`& i); static std::string :target:`toString`(const :ref:`Uint32`& i); static std::string :target:`toString`(const :ref:`Uint64`& i); static std::string :target:`toString`(const float& i); static std::string :target:`toString`(const double& i); static std::string :target:`fromFloat`(const :ref:`Float`& value, const std::string& append = "", const std::string& prepend = "", size_t digitsAfterComma = 2); static std::string :target:`fromDouble`(const double& value, const std::string& append = "", const std::string& prepend = "", size_t digitsAfterComma = 2); static bool :ref:`fromString`(:ref:`Int8`& t, const std::string& s, int base = 10); static bool :target:`fromString`(:ref:`Int16`& t, const std::string& s, int base = 10); static bool :target:`fromString`(:ref:`Int32`& t, const std::string& s, int base = 10); static bool :target:`fromString`(:ref:`Int64`& t, const std::string& s, int base = 10); static bool :target:`fromString`(:ref:`Uint8`& t, const std::string& s, int base = 10); static bool :target:`fromString`(:ref:`Uint16`& t, const std::string& s, int base = 10); static bool :target:`fromString`(:ref:`Uint32`& t, const std::string& s, int base = 10); static bool :target:`fromString`(:ref:`Uint64`& t, const std::string& s, int base = 10); static bool :target:`fromString`(float& t, const std::string& s); static bool :target:`fromString`(double& t, const std::string& s); static bool :ref:`fromString`(:ref:`Int8`& t, const String& s, int base = 10); static bool :target:`fromString`(:ref:`Int16`& t, const String& s, int base = 10); static bool :target:`fromString`(:ref:`Int32`& t, const String& s, int base = 10); static bool :target:`fromString`(:ref:`Int64`& t, const String& s, int base = 10); static bool :target:`fromString`(:ref:`Uint8`& t, const String& s, int base = 10); static bool :target:`fromString`(:ref:`Uint16`& t, const String& s, int base = 10); static bool :target:`fromString`(:ref:`Uint32`& t, const String& s, int base = 10); static bool :target:`fromString`(:ref:`Uint64`& t, const String& s, int base = 10); static bool :target:`fromString`(float& t, const String& s); static bool :target:`fromString`(double& t, const String& s); template static std::string :target:`format`(std::string_view format, Args&&... args); static void :ref:`formatBuffer`(char* Buffer, int BufferSize, const char* format, ...); static String :ref:`fromUtf8`(const std::string& utf8String); static size_t :ref:`utf8Length`(const std::string& utf8String); static String :ref:`fromUtf8`(const std::string_view& utf8String); static size_t :ref:`utf8Length`(const std::string_view& utf8String); static size_t :ref:`utf8ToCodepointPosition`(const std::string_view& utf8Text, size_t utf8Pos); static :ref:`Uint32` :ref:`utf8Next`(char*& utf8String); static size_t :ref:`toUtf32`(std::string_view utf8str, :ref:`String::StringBaseType`* buffer, size_t bufferSize); static bool :ref:`globMatch`(std::string_view text, std::string_view glob, bool caseInsensitive = false); static bool :ref:`globMatch`(const std::string_view& text, const std::vector& globs, bool caseInsensitive = false); static String :target:`fromWide`(const wchar_t* wideString); static String :target:`fromUtf16`(const char* utf16String, const size_t& utf16StringSize, bool isBigEndian = false); static String :target:`fromLatin1`(const char* string, const size_t& stringSize); static std::string :target:`getFirstLine`(const std::string& string); template static const StrType* :target:`intToStrBuf`(IntType value, StrType* buffer, size_t bufferSize, size_t padding, StrType padChar); static void :target:`readBySeparator`(std::string_view buf, std::function onSepChunkRead, char sep = '\n'); static void :target:`readBySeparator`(:ref:`String::View` buf, std::function`)> onSepChunkRead, :ref:`String::StringBaseType` sep = L'\n'); static size_t :target:`countLines`(std::string_view text); static size_t :target:`countLines`(:ref:`String::View` text); :ref:`operator std::string`() const; std::wstring :ref:`toWideString`() const; std::string :ref:`toUtf8`() const; std::basic_string :ref:`toUtf16`() const; :ref:`HashType` :ref:`getHash`() const; String& :ref:`operator=`(const String& right); String& :target:`operator=`(String&& right); String& :target:`operator=`(const :ref:`StringBaseType`& right); String& :ref:`operator+=`(const String& right); String& :target:`operator+=`(const :ref:`StringBaseType`& right); const :ref:`StringBaseType`& :ref:`operator[]`(std::size_t index) const; :ref:`StringBaseType`& :ref:`operator[]`(std::size_t index); const :ref:`StringBaseType`& :ref:`at`(std::size_t index) const; void :ref:`clear`(); std::size_t :ref:`size`() const; std::size_t :ref:`length`() const; bool :ref:`empty`() const; void :ref:`erase`(std::size_t position, std::size_t count = 1); String& :ref:`insert`(std::size_t position, const String& str); String& :target:`insert`(size_t pos1, const char* s, size_t n); String& :target:`insert`(std::size_t pos1, const String& str, std::size_t pos2, std::size_t n); String& :target:`insert`(std::size_t pos1, const char* s); String& :target:`insert`(std::size_t pos1, size_t n, const :ref:`String::StringBaseType`& c); :ref:`Iterator` :target:`insert`(:ref:`Iterator` p, const :ref:`String::StringBaseType`& c); void :target:`insert`(:ref:`Iterator` p, std::size_t n, const :ref:`StringBaseType`& c); template void :target:`insert`(:ref:`Iterator` p, InputIterator first, InputIterator last); std::size_t :ref:`find`(const String& str, std::size_t start = 0) const; std::size_t :target:`find`(const char* s, std::size_t pos, std::size_t n) const; std::size_t :target:`find`(const char* s, std::size_t pos = 0) const; std::size_t :target:`find`(const :ref:`String::StringBaseType`& c, std::size_t pos = 0) const; const :ref:`StringBaseType`* :ref:`c_str`() const; const :ref:`StringBaseType`* :ref:`data`() const; :ref:`Iterator` :ref:`begin`(); :ref:`ConstIterator` :ref:`begin`() const; :ref:`Iterator` :ref:`end`(); :ref:`ConstIterator` :ref:`end`() const; :ref:`ReverseIterator` :ref:`rbegin`(); :ref:`ConstReverseIterator` :ref:`rbegin`() const; :ref:`ReverseIterator` :ref:`rend`(); :ref:`ConstReverseIterator` :ref:`rend`() const; void :ref:`resize`(std::size_t n, :ref:`StringBaseType` c); void :ref:`resize`(std::size_t n); std::size_t :ref:`max_size`() const; void :ref:`reserve`(size_t res_arg = 0); std::size_t :ref:`capacity`() const; void :ref:`push_back`(:ref:`StringBaseType` c); void :ref:`swap`(String& str); String& :target:`assign`(const String& str); String& :target:`assign`(const String& str, std::size_t pos, std::size_t n); String& :target:`assign`(const char* s); String& :target:`assign`(std::size_t n, :ref:`StringBaseType` c); template String& :target:`assign`(InputIterator first, InputIterator last); String& :target:`append`(const String& str); String& :target:`append`(const String& str, std::size_t pos, std::size_t n); String& :target:`append`(const char* s); String& :target:`append`(std::size_t n, char c); String& :target:`append`(std::size_t n, :ref:`StringBaseType` c); template String& :target:`append`(InputIterator first, InputIterator last); String& :target:`replace`(std::size_t pos1, std::size_t n1, const String& str); String& :target:`replace`(:ref:`Iterator` i1, :ref:`Iterator` i2, const String& str); String& :target:`replace`(std::size_t pos1, std::size_t n1, const String& str, std::size_t pos2, std::size_t n2); String& :target:`replace`(std::size_t pos1, std::size_t n1, const char* s, std::size_t n2); String& :target:`replace`(:ref:`Iterator` i1, :ref:`Iterator` i2, const char* s, std::size_t n2); String& :target:`replace`(std::size_t pos1, std::size_t n1, const char* s); String& :target:`replace`(:ref:`Iterator` i1, :ref:`Iterator` i2, const char* s); String& :target:`replace`(std::size_t pos1, std::size_t n1, std::size_t n2, :ref:`StringBaseType` c); String& :target:`replace`(:ref:`Iterator` i1, :ref:`Iterator` i2, std::size_t n2, :ref:`StringBaseType` c); template String& :target:`replace`(:ref:`Iterator` i1, :ref:`Iterator` i2, InputIterator j1, InputIterator j2); std::size_t :target:`rfind`(const String& str, std::size_t pos = StringType::npos) const; std::size_t :target:`rfind`(const char* s, std::size_t pos = StringType::npos) const; std::size_t :target:`rfind`(const :ref:`StringBaseType`& c, std::size_t pos = StringType::npos) const; String :target:`substr`(std::size_t pos = 0, std::size_t n = StringType::npos) const; std::size_t :target:`copy`(:ref:`StringBaseType`* s, std::size_t n, std::size_t pos = 0) const; int :target:`compare`(const String& str) const; int :target:`compare`(const char* s) const; int :target:`compare`(std::size_t pos1, std::size_t n1, const String& str) const; int :target:`compare`(std::size_t pos1, std::size_t n1, const char* s) const; int :target:`compare`(std::size_t pos1, std::size_t n1, const String& str, std::size_t pos2, std::size_t n2) const; int :target:`compare`(std::size_t pos1, std::size_t n1, const char* s, std::size_t n2) const; std::size_t :target:`find_first_of`(const String& str, std::size_t pos = 0) const; std::size_t :target:`find_first_of`(const char* s, std::size_t pos = 0) const; std::size_t :target:`find_first_of`(:ref:`StringBaseType` c, std::size_t pos = 0) const; std::size_t :target:`find_last_of`(const String& str, std::size_t pos = StringType::npos) const; std::size_t :target:`find_last_of`(const char* s, std::size_t pos = StringType::npos) const; std::size_t :target:`find_last_of`(:ref:`StringBaseType` c, std::size_t pos = StringType::npos) const; std::size_t :target:`find_first_not_of`(const String& str, std::size_t pos = 0) const; std::size_t :target:`find_first_not_of`(const char* s, std::size_t pos = 0) const; std::size_t :target:`find_first_not_of`(:ref:`StringBaseType` c, std::size_t pos = 0) const; std::size_t :target:`find_last_not_of`(const String& str, std::size_t pos = StringType::npos) const; std::size_t :target:`find_last_not_of`(const char* s, std::size_t pos = StringType::npos) const; std::size_t :target:`find_last_not_of`(:ref:`StringBaseType` c, std::size_t pos = StringType::npos) const; size_t :target:`countChar`(:ref:`StringBaseType` c) const; String& :target:`padLeft`(unsigned int minDigits, :ref:`StringBaseType` padChar); String& :target:`toLower`(); String& :target:`toUpper`(); String& :target:`capitalize`(); String& :target:`escape`(); String& :target:`unescape`(); :ref:`StringBaseType` :target:`lastChar`() const; std::vector :target:`split`(const :ref:`StringBaseType`& delim = '\n', const bool& pushEmptyString = false, const bool& keepDelim = false) const; String :target:`getFirstLine`(); void :ref:`replaceAll`(const String& that, const String& with); void :target:`pop_back`(); const :ref:`StringBaseType`& :target:`front`() const; const :ref:`StringBaseType`& :target:`back`() const; String& :target:`trim`(char character = ' '); String& :target:`lTrim`(char character = ' '); String& :target:`rTrim`(char character = ' '); bool :ref:`contains`(const String& needle) const; bool :target:`isAscii`() const; :ref:`String::View` :target:`view`() const; const :ref:`StringType`& :target:`getString`() const; :ref:`EE_API` bool :ref:`operator==`(const String& left, const String& right); :ref:`EE_API` bool :ref:`operator!=`(const String& left, const String& right); :ref:`EE_API` bool :ref:`operator<`(const String& left, const String& right); :ref:`EE_API` bool :ref:`operator>`(const String& left, const String& right); :ref:`EE_API` bool :ref:`operator<=`(const String& left, const String& right); :ref:`EE_API` bool :ref:`operator>=`(const String& left, const String& right); :ref:`EE_API` String :ref:`operator+`(const String& left, const String& right); }; .. _details-class_e_e_1_1_string: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Utility string class that automatically handles conversions between types and encodings :ref:`EE::String ` is a utility string class defined mainly for convenience. It is a Unicode string (implemented using UTF-32), thus it can store any character in the world (european, chinese, arabic, hebrew, etc.). It automatically handles conversions from/to UTF-8 and wide strings, so that you can work with standard string classes and still be compatible with functions taking a :ref:`EE::String `. .. ref-code-block:: cpp EE::String s; std::string s1 = s; // automatically converted to UTF-8 string String s2 = s; // automatically converted to wide string s = "hello"; // automatically converted from UTF-8 string s = L"hello"; // automatically converted from wide string s += 'a'; // automatically converted from UTF-8 string s += L'a'; // automatically converted from wide string :ref:`EE::String ` defines the most important functions of the standard std::string class: removing, random access, iterating, appending, comparing, etc. However it is a simple class provided for convenience, and you may have to consider using a more optimized class if your program requires complex string handling. The automatic conversion functions will then take care of converting your string to :ref:`EE::String ` whenever :ref:`EE ` requires it. Please note that :ref:`EE ` also defines a low-level, generic interface for Unicode handling, see the :ref:`EE::Utf ` classes. All credits to Laurent Gomila, i just modified and expanded a little bit the implementation. Typedefs -------- .. index:: pair: typedef; ConstIterator .. _doxid-class_e_e_1_1_string_1a95ce10a148456fba9139c2244c8d6479: .. ref-code-block:: cpp :class: doxyrest-title-code-block typedef StringType::const_iterator ConstIterator Iterator type. .. index:: pair: typedef; ReverseIterator .. _doxid-class_e_e_1_1_string_1a8fb9993282625c82ec13b77715964754: .. ref-code-block:: cpp :class: doxyrest-title-code-block typedef StringType::reverse_iterator ReverseIterator Constant iterator type. .. index:: pair: typedef; ConstReverseIterator .. _doxid-class_e_e_1_1_string_1ab4b1087252ef5720901c26fb65008678: .. ref-code-block:: cpp :class: doxyrest-title-code-block typedef StringType::const_reverse_iterator ConstReverseIterator Reverse Iterator type. .. index:: pair: typedef; HashType .. _doxid-class_e_e_1_1_string_1a105c2ab365f2a3085c714617f129b386: .. ref-code-block:: cpp :class: doxyrest-title-code-block typedef :ref:`Uint32` HashType Constant iterator type. Fields ------ .. index:: pair: variable; InvalidPos .. _doxid-class_e_e_1_1_string_1a3b4a1e32bb9becd0a10fc113bda07783: .. ref-code-block:: cpp :class: doxyrest-title-code-block static const std::size_t InvalidPos Represents an invalid position in the string. Construction ------------ .. index:: pair: function; String .. _doxid-class_e_e_1_1_string_1ab23b3467ef6675e6d8c7764c3a9a79a8: .. ref-code-block:: cpp :class: doxyrest-title-code-block String() Default constructor This constructor creates an empty string. .. index:: pair: function; String .. _doxid-class_e_e_1_1_string_1ab2a8b7a99b3f0c1523540b7b383c4056: .. ref-code-block:: cpp :class: doxyrest-title-code-block String(char ansiChar) Construct from a single ANSI character. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - ansiChar - ANSI character to convert .. index:: pair: function; String .. _doxid-class_e_e_1_1_string_1ae1647d1338aacf60acecfa8c174c92b5: .. ref-code-block:: cpp :class: doxyrest-title-code-block String(wchar_t wideChar) Construct from single wide character. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - wideChar - Wide character to convert .. index:: pair: function; String .. _doxid-class_e_e_1_1_string_1a5c9f99a780248526b6bfa8bdc133083b: .. ref-code-block:: cpp :class: doxyrest-title-code-block String(:ref:`StringBaseType` utf32Char) Construct from single UTF-32 character. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - utf32Char - UTF-32 character to convert .. index:: pair: function; String .. _doxid-class_e_e_1_1_string_1a10e171c0ffa447671b7604889b5719e7: .. ref-code-block:: cpp :class: doxyrest-title-code-block String(const char* utf8String) Construct from an from a null-terminated C-style UTF-8 string to UTF-32. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - uf8String - UTF-8 string to convert .. index:: pair: function; String .. _doxid-class_e_e_1_1_string_1a86c9c869aa0f11d8164dd4a9ae569c26: .. ref-code-block:: cpp :class: doxyrest-title-code-block String(const char* utf8String, const size_t& utf8StringSize) Construct from an from a sub-string C-style UTF-8 string to UTF-32. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - uf8String - UTF-8 string to convert .. index:: pair: function; String .. _doxid-class_e_e_1_1_string_1aa910d4e643ef1138ff8952faece6b416: .. ref-code-block:: cpp :class: doxyrest-title-code-block String(const std::string& utf8String) Construct from an UTF-8 string to UTF-32 according. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - utf8String - UTF-8 string to convert .. index:: pair: function; String .. _doxid-class_e_e_1_1_string_1a263e4dcfd6fe9ca7bc384da2d269861d: .. ref-code-block:: cpp :class: doxyrest-title-code-block String(const std::basic_string& utf8String) Construct from an UTF-8 string to UTF-32 according. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - utf8String - UTF-8 string to convert .. index:: pair: function; String .. _doxid-class_e_e_1_1_string_1a8807e5e6a194e80ef152690d0a24ca09: .. ref-code-block:: cpp :class: doxyrest-title-code-block String(const std::string_view& utf8String) Construct from an UTF-8 string to UTF-32 according. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - utf8String - UTF-8 string to convert .. index:: pair: function; String .. _doxid-class_e_e_1_1_string_1a49793fe53582130b1242f79c7c413915: .. ref-code-block:: cpp :class: doxyrest-title-code-block String(const wchar_t* wideString) Construct from null-terminated C-style wide string. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - wideString - Wide string to convert .. index:: pair: function; String .. _doxid-class_e_e_1_1_string_1ae777e87133e1b42024bddfbd4efc1e1d: .. ref-code-block:: cpp :class: doxyrest-title-code-block String(const std::wstring& wideString) Construct from a wide string. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - wideString - Wide string to convert .. index:: pair: function; String .. _doxid-class_e_e_1_1_string_1a08c3be83ba98f8de8dd65feb44caae51: .. ref-code-block:: cpp :class: doxyrest-title-code-block String(const :ref:`StringBaseType`* utf32String) Construct from a null-terminated C-style UTF-32 string. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - utf32String - UTF-32 string to assign .. index:: pair: function; String .. _doxid-class_e_e_1_1_string_1ab1ed46fa88581842a58305050afa5f63: .. ref-code-block:: cpp :class: doxyrest-title-code-block String(const :ref:`StringType`& utf32String) Construct from an UTF-32 string. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - utf32String - UTF-32 string to assign .. index:: pair: function; String .. _doxid-class_e_e_1_1_string_1a1a65a8ac105e447ca1a1540afefb4420: .. ref-code-block:: cpp :class: doxyrest-title-code-block String(const String& str) Copy constructor. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - str - Instance to copy .. index:: pair: function; String .. _doxid-class_e_e_1_1_string_1a8b63a47f56396da32fb8bafd171d3757: .. ref-code-block:: cpp :class: doxyrest-title-code-block String(const :ref:`String::View`& str) Copy constructor. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - str - Instance to copy Methods ------- .. index:: pair: function; hash .. _doxid-class_e_e_1_1_string_1ace03a970102523234262acaa6281c775: .. ref-code-block:: cpp :class: doxyrest-title-code-block static constexpr :ref:`HashType` hash(const char* str) .. rubric:: Returns: string hash .. index:: pair: function; escape .. _doxid-class_e_e_1_1_string_1aa3981985186f6c46f19241847bcbfdd2: .. ref-code-block:: cpp :class: doxyrest-title-code-block static String escape(const String& str) Escape string sequence .. index:: pair: function; unescape .. _doxid-class_e_e_1_1_string_1ab00e975ae02567c9d247cc0123b0fa36: .. ref-code-block:: cpp :class: doxyrest-title-code-block static String unescape(const String& str) Unescape string sequence .. index:: pair: function; hash .. _doxid-class_e_e_1_1_string_1a0551cba8e6eb8da98eafb1ec7d2111a6: .. ref-code-block:: cpp :class: doxyrest-title-code-block static :ref:`String::HashType` hash(const std::string& str) .. rubric:: Returns: string hash .. index:: pair: function; hash .. _doxid-class_e_e_1_1_string_1a7ade4085a033d092254e70d5a2f5c214: .. ref-code-block:: cpp :class: doxyrest-title-code-block static :ref:`String::HashType` hash(const std::string_view& str) .. rubric:: Returns: string hash .. index:: pair: function; hash .. _doxid-class_e_e_1_1_string_1a4949332c3a5618363bd43612dc4c731e: .. ref-code-block:: cpp :class: doxyrest-title-code-block static :ref:`String::HashType` hash(const String& str) .. rubric:: Returns: string hash. Note: :ref:`String::hash ` ( std::string( "text" ) ) is != to :ref:`String::hash ` (:ref:`String ` ( "text" ) ) .. index:: pair: function; isCharacter .. _doxid-class_e_e_1_1_string_1ad567412d561536f09070468da62a3294: .. ref-code-block:: cpp :class: doxyrest-title-code-block static bool isCharacter(const int& value) .. rubric:: Returns: If the value passed is a character .. index:: pair: function; isNumber .. _doxid-class_e_e_1_1_string_1a116fae22677adb79b2fd1971c0135082: .. ref-code-block:: cpp :class: doxyrest-title-code-block static bool isNumber(const int& value, bool AllowDot = false) .. rubric:: Returns: If the value passed is a number .. index:: pair: function; isNumber .. _doxid-class_e_e_1_1_string_1a1024822dcbb310e05e87482559f21618: .. ref-code-block:: cpp :class: doxyrest-title-code-block static bool isNumber(const std::string& value, bool AllowDot = false) .. rubric:: Returns: If the string represents a number. .. index:: pair: function; isLetter .. _doxid-class_e_e_1_1_string_1ac5150300e0545f71b930ae02a31f9025: .. ref-code-block:: cpp :class: doxyrest-title-code-block static bool isLetter(const int& value) .. rubric:: Returns: If the value passed is a letter .. index:: pair: function; isAlphaNum .. _doxid-class_e_e_1_1_string_1aa75fb50d6a8ea1c2d247252e87232206: .. ref-code-block:: cpp :class: doxyrest-title-code-block static bool isAlphaNum(const int& value) .. rubric:: Returns: If the value passed is a letter or a number .. index:: pair: function; isHexNotation .. _doxid-class_e_e_1_1_string_1a12aa7b38155f506c0f5d7bc4e129c66b: .. ref-code-block:: cpp :class: doxyrest-title-code-block static bool isHexNotation(const std::string& value, const std::string& withPrefix = "") .. rubric:: Returns: If the string is a representation of a hexa number .. index:: pair: function; isWholeWord .. _doxid-class_e_e_1_1_string_1a2d4cdbade67c662bce6e4c1d839f7a44: .. ref-code-block:: cpp :class: doxyrest-title-code-block static bool isWholeWord(const std::string& haystack, const std::string& needle, const :ref:`Int64`& startPos) .. rubric:: Returns: If the needle substring, found starting at startPos is a whole-word. .. index:: pair: function; isWholeWord .. _doxid-class_e_e_1_1_string_1af064287d3ebb85e389fb3a6b9c4eec2b: .. ref-code-block:: cpp :class: doxyrest-title-code-block static bool isWholeWord(const String& haystack, const String& needle, const :ref:`Int64`& startPos) .. rubric:: Returns: If the needle substring, found starting at startPos is a whole-word. .. index:: pair: function; split .. _doxid-class_e_e_1_1_string_1acad4ddd49e68ac7cb0209a2a6bbd57f8: .. ref-code-block:: cpp :class: doxyrest-title-code-block static std::vector split(const String& str, const :ref:`StringBaseType`& delim = '\n', const bool& pushEmptyString = false, const bool& keepDelim = false) Split a :ref:`String ` and hold it on a vector .. index:: pair: function; split .. _doxid-class_e_e_1_1_string_1aa28f05fee47b085aafa3a335fccc8e1a: .. ref-code-block:: cpp :class: doxyrest-title-code-block static std::vector split(const std::string& str, const :ref:`Int8`& delim = '\n', const bool& pushEmptyString = false, const bool& keepDelim = false) Split a string and hold it on a vector .. index:: pair: function; split .. _doxid-class_e_e_1_1_string_1a4892ae7e0d8a11517030e02be8bff57f: .. ref-code-block:: cpp :class: doxyrest-title-code-block static std::vector split(const std::string_view& str, const :ref:`Int8`& delim = '\n', const bool& pushEmptyString = false) Split a string and hold it on a vector .. index:: pair: function; split .. _doxid-class_e_e_1_1_string_1a9a5216f0114e4d636d1c95a43d4e573e: .. ref-code-block:: cpp :class: doxyrest-title-code-block static std::vector split(const std::string& str, const std::string& delims, const std::string& delimsPreserve = "", const std::string& quote = "\"", const bool& removeQuotes = false) Split a string and hold it on a vector. This function is meant to be used for code splitting, detects functions, arrays, braces and quotes for the splitting. .. index:: pair: function; splitCb .. _doxid-class_e_e_1_1_string_1a8546785425b0184458c4403c13a758b7: .. ref-code-block:: cpp :class: doxyrest-title-code-block static void splitCb(std::function fnCb, const std::string& str, const std::string& delims, const std::string& delimsPreserve = "", const std::string& quote = "\"", const bool& removeQuotes = false) Split a string and hold it on a vector. This function is meant to be used for code splitting, detects functions, arrays, braces and quotes for the splitting. It does not heap allocate. .. index:: pair: function; join .. _doxid-class_e_e_1_1_string_1af2cf9092827d40550823e981c9ea7246: .. ref-code-block:: cpp :class: doxyrest-title-code-block static std::string join(const std::vector& strArray, const :ref:`Int8`& joinchar = ' ', const bool& appendLastJoinChar = false) Joins a string vector into a single string .. index:: pair: function; join .. _doxid-class_e_e_1_1_string_1a2ef9dfb1941bd5f907e5905d6e6a889d: .. ref-code-block:: cpp :class: doxyrest-title-code-block static String join(const std::vector& strArray, const :ref:`Int8`& joinchar = ' ', const bool& appendLastJoinChar = false) Joins a string vector into a single string .. index:: pair: function; lTrim .. _doxid-class_e_e_1_1_string_1a65165191679eac2e333998d3896f7e8b: .. ref-code-block:: cpp :class: doxyrest-title-code-block static std::string lTrim(const std::string& str, char character = ' ') Removes the trailing prefix. .. index:: pair: function; rTrim .. _doxid-class_e_e_1_1_string_1a8519579c7207ced773279e4d3d6d9ae6: .. ref-code-block:: cpp :class: doxyrest-title-code-block static std::string rTrim(const std::string& str, char character = ' ') Removes the trailing suffix. .. index:: pair: function; trim .. _doxid-class_e_e_1_1_string_1a19848c48ba60194c983ea87251475557: .. ref-code-block:: cpp :class: doxyrest-title-code-block static std::string trim(const std::string& str, char character = ' ') Removes all spaces ( or the specified character ) on the string .. index:: pair: function; lTrim .. _doxid-class_e_e_1_1_string_1a610700fdb1c5cecd903e53c9c07455b8: .. ref-code-block:: cpp :class: doxyrest-title-code-block static std::string_view lTrim(const std::string_view& str, char character = ' ') Removes the trailing prefix. .. index:: pair: function; rTrim .. _doxid-class_e_e_1_1_string_1a4eaac3af2610f0463327a1390fb48e16: .. ref-code-block:: cpp :class: doxyrest-title-code-block static std::string_view rTrim(const std::string_view& str, char character = ' ') Removes the trailing suffix. .. index:: pair: function; trim .. _doxid-class_e_e_1_1_string_1a762d69e41acbc92bfd207a6b3e7c8945: .. ref-code-block:: cpp :class: doxyrest-title-code-block static std::string_view trim(const std::string_view& str, char character = ' ') Removes all spaces ( or the specified character ) on the string .. index:: pair: function; lTrim .. _doxid-class_e_e_1_1_string_1af0947700830a01919d2cb37f8b303016: .. ref-code-block:: cpp :class: doxyrest-title-code-block static :ref:`String::View` lTrim(const :ref:`String::View`& str, char character = ' ') Removes the trailing prefix. .. index:: pair: function; rTrim .. _doxid-class_e_e_1_1_string_1afc970c03c24a696dfd0a26f395d00888: .. ref-code-block:: cpp :class: doxyrest-title-code-block static :ref:`String::View` rTrim(const :ref:`String::View`& str, char character = ' ') Removes the trailing suffix. .. index:: pair: function; trim .. _doxid-class_e_e_1_1_string_1aad2ad6dbe367f3db2f1fbd84bd49de87: .. ref-code-block:: cpp :class: doxyrest-title-code-block static :ref:`String::View` trim(const :ref:`String::View`& str, char character = ' ') Removes all spaces ( or the specified character ) on the string .. index:: pair: function; trimInPlace .. _doxid-class_e_e_1_1_string_1a2a7c51c9d0f75a186f1f08b458ce27ba: .. ref-code-block:: cpp :class: doxyrest-title-code-block static void trimInPlace(std::string& str, char character = ' ') Removes all spaces ( or the specified character ) on the string .. index:: pair: function; lTrim .. _doxid-class_e_e_1_1_string_1aba762861015a1ca406fc8f350f80e72c: .. ref-code-block:: cpp :class: doxyrest-title-code-block static String lTrim(const String& str, char character = ' ') Removes the trailing prefix. .. index:: pair: function; rTrim .. _doxid-class_e_e_1_1_string_1a147d22b71047a20186ad4fa253e747b6: .. ref-code-block:: cpp :class: doxyrest-title-code-block static String rTrim(const String& str, char character = ' ') Removes the trailing suffix. .. index:: pair: function; trim .. _doxid-class_e_e_1_1_string_1abbe439a2ee04f05689bfc8647a9ded80: .. ref-code-block:: cpp :class: doxyrest-title-code-block static String trim(const String& str, char character = ' ') Removes all spaces ( or the specified character ) on the string .. index:: pair: function; trimInPlace .. _doxid-class_e_e_1_1_string_1ab67fa834d06ac9b6b84d73e5c2135ec2: .. ref-code-block:: cpp :class: doxyrest-title-code-block static void trimInPlace(String& str, char character = ' ') Removes all spaces ( or the specified character ) on the string .. index:: pair: function; lTrim .. _doxid-class_e_e_1_1_string_1ad13d083aa63ab923c99003f4ecea6b0b: .. ref-code-block:: cpp :class: doxyrest-title-code-block static std::string lTrim(const std::string& str, std::string_view characters) Removes the trailing prefix. .. index:: pair: function; rTrim .. _doxid-class_e_e_1_1_string_1ab6acbac474607c8108276eae180ab29b: .. ref-code-block:: cpp :class: doxyrest-title-code-block static std::string rTrim(const std::string& str, std::string_view characters) Removes the trailing suffix. .. index:: pair: function; trim .. _doxid-class_e_e_1_1_string_1a4dcf0169fb171b55106a2e8db4282390: .. ref-code-block:: cpp :class: doxyrest-title-code-block static std::string trim(const std::string& str, std::string_view characters) Removes all spaces ( or the specified character ) on the string .. index:: pair: function; lTrim .. _doxid-class_e_e_1_1_string_1ae19fb3b7de2de3658425c76c5216b1ed: .. ref-code-block:: cpp :class: doxyrest-title-code-block static std::string_view lTrim(const std::string_view& str, std::string_view characters) Removes the trailing prefix. .. index:: pair: function; rTrim .. _doxid-class_e_e_1_1_string_1aeb2cc26a6fb7bda40678eeccb13ac3a4: .. ref-code-block:: cpp :class: doxyrest-title-code-block static std::string_view rTrim(const std::string_view& str, std::string_view characters) Removes the trailing suffix. .. index:: pair: function; trim .. _doxid-class_e_e_1_1_string_1a2434cf77b7568ed291cc4303b1b5bbe1: .. ref-code-block:: cpp :class: doxyrest-title-code-block static std::string_view trim(const std::string_view& str, std::string_view characters) Removes all spaces ( or the specified character ) on the string .. index:: pair: function; lTrim .. _doxid-class_e_e_1_1_string_1a97aaf052a2bf29f1dba35883fa0c3d37: .. ref-code-block:: cpp :class: doxyrest-title-code-block static :ref:`String::View` lTrim(const :ref:`String::View`& str, :ref:`String::View` characters) Removes the trailing prefix. .. index:: pair: function; rTrim .. _doxid-class_e_e_1_1_string_1ac1d2341531bcfc722e58c927a3c7b4d2: .. ref-code-block:: cpp :class: doxyrest-title-code-block static :ref:`String::View` rTrim(const :ref:`String::View`& str, :ref:`String::View` characters) Removes the trailing suffix. .. index:: pair: function; trim .. _doxid-class_e_e_1_1_string_1abab0e4935a5b674908c77d3a9153f7cb: .. ref-code-block:: cpp :class: doxyrest-title-code-block static :ref:`String::View` trim(const :ref:`String::View`& str, :ref:`String::View` characters) Removes all spaces ( or the specified character ) on the string .. index:: pair: function; trimInPlace .. _doxid-class_e_e_1_1_string_1a58a6a1e4231101aa2281031a93c05ec8: .. ref-code-block:: cpp :class: doxyrest-title-code-block static void trimInPlace(std::string& str, std::string_view characters) Removes all spaces ( or the specified character ) on the string .. index:: pair: function; lTrim .. _doxid-class_e_e_1_1_string_1a22955756265aac883da5860a2c28bb5c: .. ref-code-block:: cpp :class: doxyrest-title-code-block static String lTrim(const String& str, std::string_view characters) Removes the trailing prefix. .. index:: pair: function; rTrim .. _doxid-class_e_e_1_1_string_1ace824f8512f76012cde2390370df42af: .. ref-code-block:: cpp :class: doxyrest-title-code-block static String rTrim(const String& str, std::string_view characters) Removes the trailing suffix. .. index:: pair: function; trim .. _doxid-class_e_e_1_1_string_1adb4ad78328df62d2bd6e5e8e4d7fc90b: .. ref-code-block:: cpp :class: doxyrest-title-code-block static String trim(const String& str, std::string_view characters) Removes all spaces ( or the specified character ) on the string .. index:: pair: function; trimInPlace .. _doxid-class_e_e_1_1_string_1a8c2511a9cbffcd10e927d67cc3e236d8: .. ref-code-block:: cpp :class: doxyrest-title-code-block static void trimInPlace(String& str, std::string_view characters) Removes all spaces ( or the specified character ) on the string .. index:: pair: function; toUpperInPlace .. _doxid-class_e_e_1_1_string_1a37c662a8971d3d89152bd79f982fe35a: .. ref-code-block:: cpp :class: doxyrest-title-code-block static void toUpperInPlace(std::string& str) Convert the string into upper case string .. index:: pair: function; toUpper .. _doxid-class_e_e_1_1_string_1a02039f9b2c3aef97136620b51e5c8e45: .. ref-code-block:: cpp :class: doxyrest-title-code-block static std::string toUpper(std::string str) Convert a string to lower case .. index:: pair: function; toLowerInPlace .. _doxid-class_e_e_1_1_string_1a6afb4fea8c7ebe10f9eef2b42d8de99c: .. ref-code-block:: cpp :class: doxyrest-title-code-block static void toLowerInPlace(std::string& str) Convert the reference of a string into lower case string .. index:: pair: function; capitalizeInPlace .. _doxid-class_e_e_1_1_string_1a05f48af2256c2fb8606319370813766c: .. ref-code-block:: cpp :class: doxyrest-title-code-block static void capitalizeInPlace(std::string& str) Capitalizes the reference of a string .. index:: pair: function; toLower .. _doxid-class_e_e_1_1_string_1ae107e80b3263258bf4e714f54b70f7b3: .. ref-code-block:: cpp :class: doxyrest-title-code-block static std::string toLower(std::string str) Convert a string to lower case .. index:: pair: function; capitalize .. _doxid-class_e_e_1_1_string_1a2d127f25b6961e176020dfc2b3d222e7: .. ref-code-block:: cpp :class: doxyrest-title-code-block static std::string capitalize(std::string str) Catitalize a string .. index:: pair: function; toUpper .. _doxid-class_e_e_1_1_string_1a198dde135089cf4e07bed1a25bd48e21: .. ref-code-block:: cpp :class: doxyrest-title-code-block static String toUpper(const String& str) Convert a string to lower case .. index:: pair: function; toLower .. _doxid-class_e_e_1_1_string_1a836315c14a78e8f885081a58797995ce: .. ref-code-block:: cpp :class: doxyrest-title-code-block static String toLower(const String& str) Convert a string to lower case .. index:: pair: function; capitalize .. _doxid-class_e_e_1_1_string_1ad2f093f325665fbc5b4ca877dce6498c: .. ref-code-block:: cpp :class: doxyrest-title-code-block static String capitalize(const String& str) Capitalizes a string .. index:: pair: function; stringToUint8 .. _doxid-class_e_e_1_1_string_1a0b481f56c41dc5dd74bdf1f43f4b1902: .. ref-code-block:: cpp :class: doxyrest-title-code-block static std::vector<:ref:`Uint8`> stringToUint8(const std::string& str) Convert the string to an std::vector .. index:: pair: function; Uint8ToString .. _doxid-class_e_e_1_1_string_1a990d5de00a6d7d121acc13595e05b5da: .. ref-code-block:: cpp :class: doxyrest-title-code-block static std::string Uint8ToString(const std::vector<:ref:`Uint8`>& v) Convert the std::vector to an string .. index:: pair: function; insertChar .. _doxid-class_e_e_1_1_string_1a2076e1d465245a5305d0907f18ce1f8b: .. ref-code-block:: cpp :class: doxyrest-title-code-block static void insertChar(String& str, const unsigned int& pos, const :ref:`StringBaseType`& tchar) Insert a char into :ref:`String ` on pos (added this function to avoid a bug on :ref:`String `) .. index:: pair: function; strCopy .. _doxid-class_e_e_1_1_string_1a82262e45def658597868a1105db4b7b8: .. ref-code-block:: cpp :class: doxyrest-title-code-block static void strCopy(char* Dst, const char* Src, unsigned int DstSize) Copy a string to another .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - Dst - Destination :ref:`String ` * - Src - Source :ref:`String ` * - DstSize - Destination Size .. index:: pair: function; startsWith .. _doxid-class_e_e_1_1_string_1afb1f1ba66865bf0ebd7d04b6ed436ecf: .. ref-code-block:: cpp :class: doxyrest-title-code-block static bool startsWith(const std::string& haystack, const std::string& needle) Compare two strings from its beginning. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - haystack - The string to search in. * - needle - The searched string. .. rubric:: Returns: true if string starts with the substring .. index:: pair: function; startsWith .. _doxid-class_e_e_1_1_string_1a01dd032beaf8bcbceedbc77ad6093a86: .. ref-code-block:: cpp :class: doxyrest-title-code-block static bool startsWith(const String& haystack, const String& needle) Compare two strings from its beginning. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - haystack - The string to search in. * - needle - The searched string. .. rubric:: Returns: true if string starts with the substring .. index:: pair: function; startsWith .. _doxid-class_e_e_1_1_string_1a371c72a60c5351fc6e2569bcdf669fb4: .. ref-code-block:: cpp :class: doxyrest-title-code-block static bool startsWith(const char* haystack, const char* needle) Compare two strings from its beginning. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - haystack - The string to search in. * - needle - The searched string. .. rubric:: Returns: true if string starts with the substring .. index:: pair: function; startsWith .. _doxid-class_e_e_1_1_string_1a4934a2c88af58ff472f323aa59c8f9c3: .. ref-code-block:: cpp :class: doxyrest-title-code-block static bool startsWith(std::string_view haystack, std::string_view needle) Compare two strings from its beginning. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - haystack - The string to search in. * - needle - The searched string. .. rubric:: Returns: true if string starts with the substring .. index:: pair: function; endsWith .. _doxid-class_e_e_1_1_string_1a8eb1c8c2e2640fdacdb3521a32ebb077: .. ref-code-block:: cpp :class: doxyrest-title-code-block static bool endsWith(const std::string& haystack, const std::string& needle) Compare two strings from its end. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - haystack - The string to search in. * - needle - The searched string. .. rubric:: Returns: true if string starts with the substring .. index:: pair: function; endsWith .. _doxid-class_e_e_1_1_string_1a03f623d8a67f810b0a3edcaf7161221a: .. ref-code-block:: cpp :class: doxyrest-title-code-block static bool endsWith(const String& haystack, const String& needle) Compare two strings from its end. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - haystack - The string to search in. * - needle - The searched string. .. rubric:: Returns: true if string starts with the substring .. index:: pair: function; contains .. _doxid-class_e_e_1_1_string_1aff84b25bfd375101020e70dbbf0d65fa: .. ref-code-block:: cpp :class: doxyrest-title-code-block static bool contains(const std::string& haystack, const std::string& needle) .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - haystack - The string to search in. * - needle - The searched string. .. rubric:: Returns: True if a string contains a substring. .. index:: pair: function; contains .. _doxid-class_e_e_1_1_string_1a5b6b167a333d6984635fd46ca49a79a0: .. ref-code-block:: cpp :class: doxyrest-title-code-block static bool contains(const String& haystack, const String& needle) .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - haystack - The string to search in. * - needle - The searched string. .. rubric:: Returns: True if a string contains a substring. .. index:: pair: function; contains .. _doxid-class_e_e_1_1_string_1a84359517a152226322e02a62a2e6a5a9: .. ref-code-block:: cpp :class: doxyrest-title-code-block static bool contains(std::string_view haystack, std::string_view needle) .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - haystack - The string to search in. * - needle - The searched string. .. rubric:: Returns: True if a string contains a substring. .. index:: pair: function; icontains .. _doxid-class_e_e_1_1_string_1a12f4910ebd1adeb7030f1b69ac2fca15: .. ref-code-block:: cpp :class: doxyrest-title-code-block static bool icontains(const std::string& haystack, const std::string& needle) .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - haystack - The string to search in. * - needle - The searched string. .. rubric:: Returns: True if a string contains a substring. Case-insensitive check. .. index:: pair: function; icontains .. _doxid-class_e_e_1_1_string_1abf748acc017fa2cdf95df90f1025cb2c: .. ref-code-block:: cpp :class: doxyrest-title-code-block static bool icontains(const String& haystack, const String& needle) .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - haystack - The string to search in. * - needle - The searched string. .. rubric:: Returns: True if a string contains a substring. Case-insensitive check. .. index:: pair: function; icontains .. _doxid-class_e_e_1_1_string_1a6ea90495f1c4918bdcd3e9f583e469e0: .. ref-code-block:: cpp :class: doxyrest-title-code-block static bool icontains(std::string_view haystack, std::string_view needle) .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - haystack - The string to search in. * - needle - The searched string. .. rubric:: Returns: True if a string contains a substring. Case-insensitive check. .. index:: pair: function; replaceAll .. _doxid-class_e_e_1_1_string_1ae90612abc2e7b250a907a091c14dcc3f: .. ref-code-block:: cpp :class: doxyrest-title-code-block static void replaceAll(std::string& target, const std::string& that, const std::string& with) Replace all occurrences of the search string with the replacement string. .. index:: pair: function; replaceAll .. _doxid-class_e_e_1_1_string_1ae71522312eec45c68c9f5b5457fbe6e8: .. ref-code-block:: cpp :class: doxyrest-title-code-block static void replaceAll(String& target, const String& that, const String& with) Replace all occurrences of the search string with the replacement string. .. index:: pair: function; replace .. _doxid-class_e_e_1_1_string_1a227875e85bb9fd33402ef0202076c97e: .. ref-code-block:: cpp :class: doxyrest-title-code-block static void replace(std::string& target, const std::string& that, const std::string& with) Replace the first ocurrence of the search string with the replacement string. .. index:: pair: function; replace .. _doxid-class_e_e_1_1_string_1ae8d728b627fe4701f4ff5b10f3ed80f3: .. ref-code-block:: cpp :class: doxyrest-title-code-block static void replace(String& target, const String& that, const String& with) Replace the first ocurrence of the search string with the replacement string. .. index:: pair: function; removeNumbersAtEnd .. _doxid-class_e_e_1_1_string_1a3b00846d84155e4d2320f9f3c6983f0b: .. ref-code-block:: cpp :class: doxyrest-title-code-block static std::string removeNumbersAtEnd(std::string txt) Removes the numbers at the end of the string .. index:: pair: function; numberClean .. _doxid-class_e_e_1_1_string_1a464a4b30ea67365e2b5a0eb8c71cfe38: .. ref-code-block:: cpp :class: doxyrest-title-code-block static std::string_view numberClean(std::string_view strNumber) Removes the trailing 0 and . in a string number .. index:: pair: function; numberClean .. _doxid-class_e_e_1_1_string_1a6388fc1517068962425e1755d2d6d642: .. ref-code-block:: cpp :class: doxyrest-title-code-block static std::string numberClean(const std::string& strNumber) Removes the trailing 0 and . in a string number .. index:: pair: function; numberCleanInPlace .. _doxid-class_e_e_1_1_string_1a982ce55a9051b8ac58778499476028d9: .. ref-code-block:: cpp :class: doxyrest-title-code-block static void numberCleanInPlace(std::string& strNumber) Removes the trailing 0 and . in a string number .. index:: pair: function; findCloseBracket .. _doxid-class_e_e_1_1_string_1a8ed82f2c1744490b8009440bcdf45b8d: .. ref-code-block:: cpp :class: doxyrest-title-code-block static std::size_t findCloseBracket(const std::string& string, std::size_t startOffset, char openBracket, char closeBracket) Searchs the position of the corresponding close bracket in a string. .. index:: pair: function; valueIndex .. _doxid-class_e_e_1_1_string_1a9609197d950563628c9af75109316873: .. ref-code-block:: cpp :class: doxyrest-title-code-block static int valueIndex(const std::string& val, const std::string& strings, int defValue = -1, char delim = ';') Having a string of values separated by a delimiter, returns the corresponding index of the searched value .. index:: pair: function; randString .. _doxid-class_e_e_1_1_string_1a75017c9a3458183697d13667a06009cf: .. ref-code-block:: cpp :class: doxyrest-title-code-block static std::string randString(size_t len, std::string dictionary = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz") Creates a random string using the dictionary characters. .. index:: pair: function; toString .. _doxid-class_e_e_1_1_string_1af45909fd0c3c1d57e2b8199598a8b952: .. ref-code-block:: cpp :class: doxyrest-title-code-block static std::string toString(const :ref:`Int8`& i) Converts from any basic type to std::string .. index:: pair: function; fromString .. _doxid-class_e_e_1_1_string_1af558885b98d08706fa4adaa67251c1ff: .. ref-code-block:: cpp :class: doxyrest-title-code-block static bool fromString(:ref:`Int8`& t, const std::string& s, int base = 10) Converts from a string to type .. index:: pair: function; fromString .. _doxid-class_e_e_1_1_string_1acfccdcf8570bc635b5b33cf725892708: .. ref-code-block:: cpp :class: doxyrest-title-code-block static bool fromString(:ref:`Int8`& t, const String& s, int base = 10) Converts from a :ref:`String ` to type .. index:: pair: function; formatBuffer .. _doxid-class_e_e_1_1_string_1a29e0a4bd621bba85c239a6c07211f9d2: .. ref-code-block:: cpp :class: doxyrest-title-code-block static void formatBuffer(char* Buffer, int BufferSize, const char* format, ...) Format a char buffer .. index:: pair: function; fromUtf8 .. _doxid-class_e_e_1_1_string_1a7b249cb4fe52855599993b1ef7822663: .. ref-code-block:: cpp :class: doxyrest-title-code-block static String fromUtf8(const std::string& utf8String) Construct from an UTF-8 string to UTF-32 according. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - utf8String - UTF-8 string to convert .. index:: pair: function; utf8Length .. _doxid-class_e_e_1_1_string_1a152ace0c5baf52181a1afcf0af7c70cc: .. ref-code-block:: cpp :class: doxyrest-title-code-block static size_t utf8Length(const std::string& utf8String) .. rubric:: Returns: The number of codepoints of the utf8 string. .. index:: pair: function; fromUtf8 .. _doxid-class_e_e_1_1_string_1a6019a22869fb5d86f0b004771ca00b96: .. ref-code-block:: cpp :class: doxyrest-title-code-block static String fromUtf8(const std::string_view& utf8String) Construct from an UTF-8 string to UTF-32 according. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - utf8String - UTF-8 string to convert .. index:: pair: function; utf8Length .. _doxid-class_e_e_1_1_string_1a0f31e78f106e6b698ca9f34121f55325: .. ref-code-block:: cpp :class: doxyrest-title-code-block static size_t utf8Length(const std::string_view& utf8String) .. rubric:: Returns: The number of codepoints of the utf8 string. .. index:: pair: function; utf8ToCodepointPosition .. _doxid-class_e_e_1_1_string_1a68f67f83b73300f049ca6987ae415c52: .. ref-code-block:: cpp :class: doxyrest-title-code-block static size_t utf8ToCodepointPosition(const std::string_view& utf8Text, size_t utf8Pos) Converts a character position from an utf8 string to a code point position .. index:: pair: function; utf8Next .. _doxid-class_e_e_1_1_string_1a466817a80a178587d8ee3af12c93fcf0: .. ref-code-block:: cpp :class: doxyrest-title-code-block static :ref:`Uint32` utf8Next(char*& utf8String) .. rubric:: Returns: The next character in a utf8 null terminated string .. index:: pair: function; toUtf32 .. _doxid-class_e_e_1_1_string_1a781a95fc43866004d0fccedbcfc6778d: .. ref-code-block:: cpp :class: doxyrest-title-code-block static size_t toUtf32(std::string_view utf8str, :ref:`String::StringBaseType`* buffer, size_t bufferSize) Converts an UTF-8 string view into an UTF-32 by using a currently allocated buffer (usefull for stack allocated buffers) .. rubric:: Returns: The number of elements written into the buffer (the string length) .. index:: pair: function; globMatch .. _doxid-class_e_e_1_1_string_1ac5f8ed186db2056c6cf37eb7a4586a6a: .. ref-code-block:: cpp :class: doxyrest-title-code-block static bool globMatch(std::string_view text, std::string_view glob, bool caseInsensitive = false) glob matches a string against a glob .. rubric:: Returns: True if matches .. index:: pair: function; globMatch .. _doxid-class_e_e_1_1_string_1a3a8a6bb9f10db52e5257129421c1c28e: .. ref-code-block:: cpp :class: doxyrest-title-code-block static bool globMatch(const std::string_view& text, const std::vector& globs, bool caseInsensitive = false) glob matches a string against a set of globs .. rubric:: Returns: True if matches .. index:: pair: function; operator std::string .. _doxid-class_e_e_1_1_string_1ad6eeb50c3b6b8d718544cec33bff9239: .. ref-code-block:: cpp :class: doxyrest-title-code-block operator std::string() const Implicit cast operator to std::string (ANSI string) The current global locale is used for conversion. If you want to explicitely specify a locale, see toAnsiString. Characters that do not fit in the target encoding are discarded from the returned string. This operator is defined for convenience, and is equivalent to calling toAnsiString(). .. rubric:: Returns: Converted ANSI string .. rubric:: See also: toAnsiString, operator :ref:`String ` .. index:: pair: function; toWideString .. _doxid-class_e_e_1_1_string_1aa1b8628e5233c8636b10c0875e9188ef: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::wstring toWideString() const Convert the unicode string to a wide string Characters that do not fit in the target encoding are discarded from the returned string. .. rubric:: Returns: Converted wide string .. rubric:: See also: toAnsiString, operator :ref:`String ` .. index:: pair: function; toUtf8 .. _doxid-class_e_e_1_1_string_1ab1698d1e7a2b9d21e2a1f47fc36ed368: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::string toUtf8() const Convert the string to a UTF-8 string .. index:: pair: function; toUtf16 .. _doxid-class_e_e_1_1_string_1a22fd74b03c29f98d2de8cbc639df6bda: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::basic_string toUtf16() const Convert the string to a UTF-16 string .. index:: pair: function; getHash .. _doxid-class_e_e_1_1_string_1ae31aa126ec209f74d83c8278ba08e648: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`HashType` getHash() const .. rubric:: Returns: The hash code of the :ref:`String ` .. index:: pair: function; operator= .. _doxid-class_e_e_1_1_string_1aa506ea7c8b30aa92d0d7490e43c64442: .. ref-code-block:: cpp :class: doxyrest-title-code-block String& operator=(const String& right) Overload of assignment operator. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - right - Instance to assign .. rubric:: Returns: Reference to self .. index:: pair: function; operator+= .. _doxid-class_e_e_1_1_string_1a92a834375785a8e1185ffec738659d9b: .. ref-code-block:: cpp :class: doxyrest-title-code-block String& operator+=(const String& right) Overload of += operator to append an UTF-32 string. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - right - :ref:`String ` to append .. rubric:: Returns: Reference to self .. index:: pair: function; operator[] .. _doxid-class_e_e_1_1_string_1ab226bf1c97dbc23e742bc4d4a8c9b4e3: .. ref-code-block:: cpp :class: doxyrest-title-code-block const :ref:`StringBaseType`& operator[](std::size_t index) const Overload of [] operator to access a character by its position This function provides read-only access to characters. Note: this function doesn't throw if *index* is out of range. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - index - Index of the character to get .. rubric:: Returns: Character at position *index* .. index:: pair: function; operator[] .. _doxid-class_e_e_1_1_string_1ae6b21b29a8404d18b2b51f44c4015aef: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`StringBaseType`& operator[](std::size_t index) Overload of [] operator to access a character by its position This function provides read and write access to characters. Note: this function doesn't throw if *index* is out of range. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - index - Index of the character to get .. rubric:: Returns: Reference to the character at position *index* .. index:: pair: function; at .. _doxid-class_e_e_1_1_string_1a434615226e7276a28e91b15bd3a0945d: .. ref-code-block:: cpp :class: doxyrest-title-code-block const :ref:`StringBaseType`& at(std::size_t index) const Get character in string Performs a range check, throwing an exception of type out_of_range in case that pos is not an actual position in the string. .. rubric:: Returns: The character at position pos in the string. .. index:: pair: function; clear .. _doxid-class_e_e_1_1_string_1ad5f16a88667539d7944d1ae6b5af22a3: .. ref-code-block:: cpp :class: doxyrest-title-code-block void clear() clear the string This function removes all the characters from the string. .. rubric:: See also: :ref:`empty `, :ref:`erase ` .. index:: pair: function; size .. _doxid-class_e_e_1_1_string_1af0d7e420e3bc69af80e2180cd4ce7f02: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::size_t size() const Get the size of the string. .. rubric:: Returns: Number of characters in the string .. rubric:: See also: :ref:`empty ` .. index:: pair: function; length .. _doxid-class_e_e_1_1_string_1a71987eb3688500b59ad458546240bcb9: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::size_t length() const .. rubric:: See also: :ref:`size() ` .. index:: pair: function; empty .. _doxid-class_e_e_1_1_string_1a8f4291dfcf066a373592a932b8b9212c: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool empty() const Check whether the string is empty or not. .. rubric:: Returns: True if the string is empty (i.e. contains no character) .. rubric:: See also: :ref:`clear `, :ref:`size ` .. index:: pair: function; erase .. _doxid-class_e_e_1_1_string_1abce604264bde1ec8877ebc4a54d9c8a2: .. ref-code-block:: cpp :class: doxyrest-title-code-block void erase(std::size_t position, std::size_t count = 1) Erase one or more characters from the string This function removes a sequence of *count* characters starting from *position*. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - position - Position of the first character to erase * - count - Number of characters to erase .. index:: pair: function; insert .. _doxid-class_e_e_1_1_string_1ae0dcc29446e752bd0a433a13e1585ed1: .. ref-code-block:: cpp :class: doxyrest-title-code-block String& insert(std::size_t position, const String& str) Insert one or more characters into the string This function inserts the characters of *str* into the string, starting from *position*. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - position - Position of insertion * - str - Characters to insert .. index:: pair: function; find .. _doxid-class_e_e_1_1_string_1a2514bd6d4d0e0fcdce3351205c6c4fd0: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::size_t find(const String& str, std::size_t start = 0) const Find a sequence of one or more characters in the string This function searches for the characters of *str* into the string, starting from *start*. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - str - Characters to find * - start - Where to begin searching .. rubric:: Returns: Position of *str* in the string, or :ref:`String::InvalidPos ` if not found .. index:: pair: function; c_str .. _doxid-class_e_e_1_1_string_1a7edcbd94ca84eca8da41044d472d3e79: .. ref-code-block:: cpp :class: doxyrest-title-code-block const :ref:`StringBaseType`* c_str() const Get a pointer to the C-style array of characters This functions provides a read-only access to a null-terminated C-style representation of the string. The returned pointer is temporary and is meant only for immediate use, thus it is not recommended to store it. .. rubric:: Returns: Read-only pointer to the array of characters .. index:: pair: function; data .. _doxid-class_e_e_1_1_string_1a4f2e62be34e30ae7bed6c96032ea1cef: .. ref-code-block:: cpp :class: doxyrest-title-code-block const :ref:`StringBaseType`* data() const Get string data Notice that no terminating null character is appended (see member c_str for such a functionality). The returned array points to an internal location which should not be modified directly in the program. Its contents are guaranteed to remain unchanged only until the next call to a non-constant member function of the string object. .. rubric:: Returns: Pointer to an internal array containing the same content as the string. .. index:: pair: function; begin .. _doxid-class_e_e_1_1_string_1a44a02c1289a998903013687c4e5fe781: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`Iterator` begin() Return an iterator to the beginning of the string. .. rubric:: Returns: Read-write iterator to the beginning of the string characters .. rubric:: See also: :ref:`end ` .. index:: pair: function; begin .. _doxid-class_e_e_1_1_string_1a0aefc885a5a1ced391f9ed7299680dba: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`ConstIterator` begin() const Return an iterator to the beginning of the string. .. rubric:: Returns: Read-only iterator to the beginning of the string characters .. rubric:: See also: :ref:`end ` .. index:: pair: function; end .. _doxid-class_e_e_1_1_string_1a4581c38b02ef25f842e2fdf24bbaa0e4: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`Iterator` end() Return an iterator to the beginning of the string The end iterator refers to 1 position past the last character; thus it represents an invalid character and should never be accessed. .. rubric:: Returns: Read-write iterator to the end of the string characters .. rubric:: See also: :ref:`begin ` .. index:: pair: function; end .. _doxid-class_e_e_1_1_string_1aaf1eb5f0e5e21aa0604cfe780e7eb8ab: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`ConstIterator` end() const Return an iterator to the beginning of the string The end iterator refers to 1 position past the last character; thus it represents an invalid character and should never be accessed. .. rubric:: Returns: Read-only iterator to the end of the string characters .. rubric:: See also: :ref:`begin ` .. index:: pair: function; rbegin .. _doxid-class_e_e_1_1_string_1aa73e721daffb5438605217ac2b9d26d7: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`ReverseIterator` rbegin() Return an reverse iterator to the beginning of the string. .. rubric:: Returns: Read-write reverse iterator to the beginning of the string characters .. rubric:: See also: :ref:`end ` .. index:: pair: function; rbegin .. _doxid-class_e_e_1_1_string_1aecc8f29419268a6e4feed4445a510846: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`ConstReverseIterator` rbegin() const Return an reverse iterator to the beginning of the string. .. rubric:: Returns: Read-only reverse iterator to the beginning of the string characters .. rubric:: See also: :ref:`end ` .. index:: pair: function; rend .. _doxid-class_e_e_1_1_string_1a8b14fa055c31eb941fd4ac698f0e8ada: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`ReverseIterator` rend() Return an reverse iterator to the beginning of the string The end reverse iterator refers to 1 position past the last character; thus it represents an invalid character and should never be accessed. .. rubric:: Returns: Read-write reverse iterator to the end of the string characters .. rubric:: See also: :ref:`begin ` .. index:: pair: function; rend .. _doxid-class_e_e_1_1_string_1a9b480548f7db9dad0c2bc83b37c34d29: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`ConstReverseIterator` rend() const Return an reverse iterator to the beginning of the string The end reverse iterator refers to 1 position past the last character; thus it represents an invalid character and should never be accessed. .. rubric:: Returns: Read-only reverse iterator to the end of the string characters .. rubric:: See also: :ref:`begin ` .. index:: pair: function; resize .. _doxid-class_e_e_1_1_string_1ae5a88b3391ce0be20686615ba83cb0a8: .. ref-code-block:: cpp :class: doxyrest-title-code-block void resize(std::size_t n, :ref:`StringBaseType` c) Resize :ref:`String `. .. index:: pair: function; resize .. _doxid-class_e_e_1_1_string_1ac90225b86bfc6b30fd8bf57dea541fa5: .. ref-code-block:: cpp :class: doxyrest-title-code-block void resize(std::size_t n) Resize :ref:`String `. .. index:: pair: function; max_size .. _doxid-class_e_e_1_1_string_1aa6435b6d8371c2e1b92a68895fbaba86: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::size_t max_size() const .. rubric:: Returns: Maximum size of string .. index:: pair: function; reserve .. _doxid-class_e_e_1_1_string_1a7eff1457f91559e4dd1847fc36819f3f: .. ref-code-block:: cpp :class: doxyrest-title-code-block void reserve(size_t res_arg = 0) Request a change in capacity. .. index:: pair: function; capacity .. _doxid-class_e_e_1_1_string_1ade22b053309a6528562894f641e73244: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::size_t capacity() const .. rubric:: Returns: Size of allocated storage .. index:: pair: function; push_back .. _doxid-class_e_e_1_1_string_1ae33b2080b73aecefce5ff705c73776e9: .. ref-code-block:: cpp :class: doxyrest-title-code-block void push_back(:ref:`StringBaseType` c) Append character to string. .. index:: pair: function; swap .. _doxid-class_e_e_1_1_string_1a1ca4b3f2c1210dc05e2d9e8e3edcd97b: .. ref-code-block:: cpp :class: doxyrest-title-code-block void swap(String& str) Swap contents with another string. .. index:: pair: function; replaceAll .. _doxid-class_e_e_1_1_string_1a396c2a592075fee405a4b18d1303edad: .. ref-code-block:: cpp :class: doxyrest-title-code-block void replaceAll(const String& that, const String& with) Replace all occurrences of the search string with the replacement string. .. index:: pair: function; contains .. _doxid-class_e_e_1_1_string_1ae0303397e98b87860856fc1b54d972ae: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool contains(const String& needle) const .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - needle - The searched string. .. rubric:: Returns: True if a string contains a substring. .. index:: pair: function; operator== .. _doxid-class_e_e_1_1_string_1aa7765e8bb417e7be78e698da13499789: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`EE_API` bool operator==(const String& left, const String& right) Overload of == operator to compare two UTF-32 strings. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - left - Left operand (a string) * - right - Right operand (a string) .. rubric:: Returns: True if both strings are equal .. index:: pair: function; operator!= .. _doxid-class_e_e_1_1_string_1adff152c3bb9ce002b2ecda407ccadbce: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`EE_API` bool operator!=(const String& left, const String& right) Overload of != operator to compare two UTF-32 strings. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - left - Left operand (a string) * - right - Right operand (a string) .. rubric:: Returns: True if both strings are different .. index:: pair: function; operator< .. _doxid-class_e_e_1_1_string_1a3dd295590c7769c69e3ce60d3bdeefb4: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`EE_API` bool operator<(const String& left, const String& right) Overload of < operator to compare two UTF-32 strings. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - left - Left operand (a string) * - right - Right operand (a string) .. rubric:: Returns: True if *left* is alphabetically lesser than *right* .. index:: pair: function; operator> .. _doxid-class_e_e_1_1_string_1aa3feb4316dd90148f97edf990e87002c: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`EE_API` bool operator>(const String& left, const String& right) Overload of > operator to compare two UTF-32 strings. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - left - Left operand (a string) * - right - Right operand (a string) .. rubric:: Returns: True if *left* is alphabetically greater than *right* .. index:: pair: function; operator<= .. _doxid-class_e_e_1_1_string_1a6e531f931b62a280a00499e62530e31c: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`EE_API` bool operator<=(const String& left, const String& right) Overload of <= operator to compare two UTF-32 strings. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - left - Left operand (a string) * - right - Right operand (a string) .. rubric:: Returns: True if *left* is alphabetically lesser or equal than *right* .. index:: pair: function; operator>= .. _doxid-class_e_e_1_1_string_1a48c73fed7b109332c1ad24438632824a: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`EE_API` bool operator>=(const String& left, const String& right) Overload of >= operator to compare two UTF-32 strings. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - left - Left operand (a string) * - right - Right operand (a string) .. rubric:: Returns: True if *left* is alphabetically greater or equal than *right* .. index:: pair: function; operator+ .. _doxid-class_e_e_1_1_string_1a5bcda8eca28b64cd3ca8833ba9caa5c9: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`EE_API` String operator+(const String& left, const String& right) Overload of binary + operator to concatenate two strings. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - left - Left operand (a string) * - right - Right operand (a string) .. rubric:: Returns: Concatenated string