15#include <initializer_list>
22 template<
typename T>
class Array;
33 static bool Equals(
char c1,
char c2) {
34 return tolower(
static_cast<unsigned char>(c1)) == tolower(
static_cast<unsigned char>(c2));
40 static bool Equals(
wchar_t c1,
wchar_t c2) {
41 return towlower(c1) == towlower(c2);
48 static constexpr const char*
True =
"True";
49 static constexpr const char*
False =
"False";
53 static constexpr const wchar_t*
True = L
"True";
54 static constexpr const wchar_t*
False = L
"False";
58 static constexpr const char*
Message =
"Input string was not in a correct format.";
62 static constexpr const wchar_t*
Message = L
"Input string was not in a correct format.";
130 if (!p1 && !p2)
return false;
131 if (!p1)
return true;
132 if (!p2)
return false;
133 return strcmp(p1, p2) < 0;
139 if (p1 == p2)
return true;
140 if (!p1 || !p2)
return false;
141 return strcmp(p1, p2) == 0;
145 if (p1 == pStr2)
return true;
146 if (!p1 || !pStr2)
return false;
147 return strcmp(p1, pStr2) == 0;
150 return sStr2 == pStr1;
154 return !(sStr1 == sStr2);
157 return !(sStr1 == pStr2);
160 return !(pStr1 == sStr2);
164 const String& sStr2,
int iIndex2,
int iLength,
178 const std::initializer_list<String> sStrs)
const;
184 int iDestArraySize,
int iCount)
const;
196 bool bIgnoreCase)
const;
206 char chSeparator, std::initializer_list<String> sStrings);
208 char chSeparator, std::initializer_list<String> sStrings,
209 int iStartIndex,
int iCount);
212 std::initializer_list<String> sStrings);
215 std::initializer_list<String> sStrings,
int iStartIndex,
238 template <
typename Arg1,
typename... Args>
239 static String Format(
const char* pFormat,
const Arg1& arg1,
const Args&... args) {
249 template <
typename Arg1,
typename... Args>
268 const String& sReplaceStr)
const;
Defines the exception thrown when an invalid argument is provided to a method.
Defines the exception thrown when an argument value is outside the acceptable range of values.
#define DOTNETDUPE_API
Platform-specific linkage decoration for exporting or importing library symbols.
Defines the exception thrown when a requested method or operation is not implemented.
Defines the exception thrown when an arithmetic, casting, or conversion operation results in an overf...
Utility routines for high-performance UTF-8, UTF-16, and wide-character string conversions.
ArgumentException(const String &sMessage)
Initializes a new instance of the ArgumentException class with a specified error message.
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Represents text as a sequence of UTF-8 code units with culture-invariant operations.
static String ValueOf(int iValue)
static String Join(char chSeparator, std::initializer_list< String > sStrings)
static String Format(const String &sFormat, const Arg1 &arg1, const Args &... args)
String & operator+=(const String &sStr)
static String FormatArgHelper(const T &arg)
static String Format(const String &sFormat)
String & operator=(const String &sStr)
Copy assignment operator.
String Concat(const std::initializer_list< String > sStrs) const
static String FormatArgHelper(long l)
String Substring(int iStartIndex) const
friend bool operator!=(const String &sStr1, const char *pStr2)
static String FormatArgHelper(std::nullptr_t)
static String FormatArgHelper(long long ll)
friend bool operator==(const String &sStr1, const char *pStr2)
const char * GetChars() const
static String FormatArgHelper(float f)
friend bool operator==(const char *pStr1, const String &sStr2)
int CompareTo(const String &sStr) const
bool StartsWith(const String &sPrefix) const
static String FormatArgHelper(const String &s)
String PadLeft(int iTotalWidth)
bool operator<(const String &sStr) const
static int Compare(const String &sStr1, int iIndex1, const String &sStr2, int iIndex2, int iLength, bool bIgnoreCase)
String Replace(char chOriginalChar, char chReplaceChar) const
String & Insert(int iIndex, const String &sStr)
void CopyTo(int iSourceIndex, char *pDestination, int iDestinationIndex, int iDestArraySize, int iCount) const
static String FromInt(int iValue)
String Remove(int iStartIndex) const
static String FormatArgHelper(int i)
friend bool operator!=(const char *pStr1, const String &sStr2)
static String FormatArgHelper(unsigned int u)
bool EndsWith(char ch, bool bIgnoreCase) const
int LastIndexOfAny(int iStartIndex, std::initializer_list< char > chChars, bool bIgnoreCase)
static String ToString(int iValue)
String()
Initializes a new instance of the String class to an empty string.
friend bool operator==(const String &sStr1, const String &sStr2)
static String FormatArgHelper(unsigned long long ull)
static String FormatArgHelper(unsigned long ul)
static String Format(const char *pFormat, const Arg1 &arg1, const Args &... args)
String & Append(const char ch)
static String FormatArgHelper(short i)
static String FormatArgHelper(char c)
int IndexOfAny(int iStartIndex, std::initializer_list< char > chChars)
static bool Equals(const String &sStr1, const String &sStr2)
int IndexOf(const String &sSubstring) const
static String InternalFormat(const char *pFormat, const String *pArgs, int iArgCount)
const char * GetRawString() const
int LastIndexOf(const String &sStr, bool bIgnoreCase)
static String FormatArgHelper(bool b)
bool Contains(char ch) const
char operator[](int iIndex) const
String & operator=(std::nullptr_t)
static String Format(const char *pFormat)
Array< String > Split(char chSeparator) const
friend bool operator!=(const String &sStr1, const String &sStr2)
static String FormatArgHelper(unsigned short i)
static String FormatArgHelper(const char *s)
String PadRight(int iTotalWidth)
static String FormatArgHelper(double d)
StringSplitOptions
Specifies whether applicable Overload:Split methods include or omit empty substrings.
@ None
Include empty substrings in the returned array.
@ TrimEntries
Trim white-space characters from each element in the array.
@ RemoveEmptyEntries
Omit substrings that contain an empty string from the array.
String operator+(const char *pStr, const String &sStr)
static constexpr const char * True
static constexpr const char * False
static constexpr const wchar_t * False
static constexpr const wchar_t * True
Helper for portable ASCII case-insensitive comparison.
static bool Equals(char c1, char c2)
Helper for portable wide-character case-insensitive comparison.
static bool Equals(wchar_t c1, wchar_t c2)