Public Types

using reverse_iterator = std::reverse_iterator< const char16_t * >
 Reverse iterator type. More...
 

Public Member Functions

 String ()
 Default constructor. Creates string object which is considered null. More...
 
template<typename T >
 String (T &value, typename std::enable_if< IsNonConstStringArray< T, char16_t >::value >::type *=nullptr)
 
template<typename T >
 String (T &value, typename std::enable_if< IsStringLiteral< T, char16_t >::value >::type *=nullptr)
 
template<typename T >
 String (const T &value, typename std::enable_if< IsStringPointer< T, char16_t >::value >::type *=nullptr)
 
 String (const char16_t *str, int length)
 
 String (const char16_t ch, int count)
 
template<typename T >
 String (const T &value, typename std::enable_if< std::is_same< T, std::nullptr_t >::value >::type *=nullptr)
 
template<typename T >
 String (T &value, typename std::enable_if< IsNonConstStringArray< T, wchar_t >::value >::type *=nullptr)
 
template<typename T >
 String (T &value, typename std::enable_if< IsStringLiteral< T, wchar_t >::value >::type *=nullptr)
 
template<typename T >
 String (const T &value, typename std::enable_if< IsStringPointer< T, wchar_t >::value >::type *=nullptr)
 
 String (const wchar_t *str, int length)
 
 String (const wchar_t ch, int count=1)
 
 String (const String &str)
 
 String (String &&str) noexcept
 
 String (const ArrayPtr< char16_t > &arr)
 
 String (const ArrayPtr< char16_t > &arr, int offset, int len)
 
 ~String ()
 Destructor. More...
 
const UChar * u_str () const
 
const UChar * begin () const
 
const UChar * end () const
 
reverse_iterator rbegin () const
 
reverse_iterator rend () const
 
bool IsNullOrEmpty () const
 
bool IsNull () const
 
bool IsEmpty () const
 
std::string ToUtf8String () const
 
std::wstring ToWCS () const
 
std::u16string ToU16Str () const
 
std::string ToAsciiString () const
 
Stringreset ()
 
int get_Length () const
 
char_t operator[] (int index) const
 
StringSetCharAt (int index, char_t ch)
 
Stringoperator= (const String &str)
 
Stringoperator= (String &&str) noexcept
 
String operator+ (const String &str) const
 
template<typename T >
std::enable_if< IsStringLiteral< T, char_t >::value, String >::type operator+ (const T &arg) const
 
String operator+ (char_t x) const
 
String operator+ (int i) const
 
String operator+ (uint32_t i) const
 
String operator+ (double d) const
 
String operator+ (int64_t v) const
 
template<typename T >
std::enable_if< IsSmartPtr< T >::value, String >::type operator+ (const T &value) const
 
template<typename T >
std::enable_if<!IsSmartPtr< T >::value &&!std::is_scalar< T >::value &&!std::is_array< T >::value, String >::type operator+ (const T &value) const
 
Stringoperator+= (char_t c)
 
Stringoperator+= (const String &str)
 
bool operator== (const String &str) const
 
bool operator== (std::nullptr_t) const
 
bool operator!= (const String &str) const
 
bool operator!= (std::nullptr_t) const
 
bool operator< (const String &str) const
 
String Clone () const
 
String ToString () const
 
String ToString (const SharedPtr< IFormatProvider > &) const
 
int GetHashCode () const
 
bool Equals (const String &str, System::StringComparison comparison_type) const
 
bool Equals (const String &str) const
 
bool Contains (const String &str) const
 
int CompareTo (const String &str) const
 
void CopyTo (int sourceIndex, const ArrayPtr< char_t > &destination, int destinationIndex, int count) const
 
String Normalize (System::Text::NormalizationForm form) const
 
bool IsNormalized (System::Text::NormalizationForm form) const
 
bool StartsWith (const String &value, System::StringComparison comparisonType) const
 
bool StartsWith (const String &value, bool ignoreCase=false, const SharedPtr< System::Globalization::CultureInfo > &culture=nullptr) const
 
bool EndsWith (const String &value, System::StringComparison comparisonType) const
 
bool EndsWith (const String &value, bool ignoreCase=false, const SharedPtr< System::Globalization::CultureInfo > &culture=nullptr) const
 
ArrayPtr< char_t > ToCharArray (int32_t startIndex=0, int32_t length=INT32_MAX) const
 
ArrayPtr< uint8_t > ToByteArray (int32_t startIndex=0, int32_t length=INT32_MAX, bool LE=true) const
 
String ToUpper () const
 
String ToLower () const
 
String ToLower (const SharedPtr< System::Globalization::CultureInfo > &cultureInfo) const
 
String ToUpper (const SharedPtr< System::Globalization::CultureInfo > &cultureInfo) const
 
String ToUpperInvariant () const
 
String ToLowerInvariant () const
 
String Substring (int32_t startIndex, int32_t length=INT32_MAX) const
 
String Remove (int32_t startIndex, int32_t count=INT32_MAX) const
 
bool Is (const System::TypeInfo &target) const
 
int IndexOf (const String &str, System::StringComparison comparison_type) const
 
int IndexOf (char_t c, int startIndex=0) const
 
int IndexOf (char_t c, int startIndex, int count) const
 
int IndexOf (const String &str, int startIndex=0) const
 
int IndexOf (const String &str, int startIndex, System::StringComparison comparison_type) const
 
int IndexOf (const String &value, int startIndex, int count, System::StringComparison comparisonType) const
 
int IndexOf (const String &str, int startIndex, int count) const
 
int IndexOfAny (char_t c, int startIndex=0) const
 
int IndexOfAny (const String &str, int startIndex=0) const
 
int IndexOfAny (const ArrayPtr< char_t > &anyOf) const
 
int IndexOfAny (const ArrayPtr< char_t > &anyOf, int32_t startindex) const
 
int IndexOfAny (const ArrayPtr< char_t > &anyOf, int32_t startindex, int32_t count) const
 
int LastIndexOf (const String &str, int startIndex=INT32_MAX) const
 
int LastIndexOf (const String &str, System::StringComparison comparison_type) const
 
int LastIndexOf (const String &value, int startIndex, int count, StringComparison comparisonType) const
 
int LastIndexOf (char_t value) const
 
int LastIndexOf (char_t value, int32_t startIndex) const
 
int LastIndexOf (char_t value, int32_t startIndex, int32_t count) const
 
int LastIndexOfAny (const ArrayPtr< char_t > &anyOf) const
 
int LastIndexOfAny (const ArrayPtr< char_t > &anyOf, int32_t startindex) const
 
int LastIndexOfAny (const ArrayPtr< char_t > &anyOf, int32_t startindex, int32_t count) const
 
String Trim () const
 
String Trim (char_t ch) const
 
String Trim (const String &anyOf) const
 
String Trim (const ArrayPtr< char_t > &anyOf) const
 
String TrimStart () const
 
String TrimStart (char_t ch) const
 
String TrimStart (const String &anyOf) const
 
String TrimStart (const ArrayPtr< char_t > &anyOf) const
 
String TrimEnd () const
 
String TrimEnd (char_t ch) const
 
String TrimEnd (const String &anyOf) const
 
String TrimEnd (const ArrayPtr< char_t > &anyOf) const
 
String PadLeft (int totalWidth, char_t c=u' ') const
 
String PadRight (int totalWidth, char_t c=u' ') const
 
String Replace (char_t oldValue, char_t newValue) const
 
String Replace (const String &oldValue, const String &newValue) const
 
String Insert (int startIndex, const String &value) const
 
ArrayPtr< StringSplit (char_t separator=u' ', StringSplitOptions opt=StringSplitOptions::None) const
 
ArrayPtr< StringSplit (char_t separator, int32_t count, StringSplitOptions opt=StringSplitOptions::None) const
 
ArrayPtr< StringSplit (char_t separatorA, char_t separatorB, StringSplitOptions opt=StringSplitOptions::None) const
 
ArrayPtr< StringSplit (const ArrayPtr< char_t > &separators, StringSplitOptions opt=StringSplitOptions::None) const
 
ArrayPtr< StringSplit (const ArrayPtr< char_t > &separators, int32_t count, StringSplitOptions opt=StringSplitOptions::None) const
 
ArrayPtr< StringSplit (const String &separator, StringSplitOptions opt=StringSplitOptions::None) const
 
ArrayPtr< StringSplit (const String &separator, int count, StringSplitOptions opt=StringSplitOptions::None) const
 
ArrayPtr< StringSplit (const ArrayPtr< String > &separators, StringSplitOptions opt=StringSplitOptions::None) const
 
ArrayPtr< StringSplit (const ArrayPtr< String > &separators, int count, StringSplitOptions opt=StringSplitOptions::None) const
 
 String (const icu::UnicodeString &str)
 
 String (icu::UnicodeString &&str) noexcept
 
 String (const std::wstring &str)
 
 String (const std::u16string &str)
 
bool IsAsciiString () const
 
int FastToAscii (char buffer[], int buffer_size) const
 

Static Public Member Functions

static bool IsNullOrEmpty (const String &str)
 
static bool Equals (const String &strA, const String &strB)
 
static bool Equals (const String &strA, const String &strB, System::StringComparison comparison_type)
 
static int Compare (const String &strA, int indexA, const String &strB, int indexB, int length, bool ignoreCase=false)
 
static int Compare (const String &strA, int indexA, const String &strB, int indexB, int length, bool ignoreCase, const SharedPtr< System::Globalization::CultureInfo > &ci)
 
static int Compare (const String &strA, const String &strB, System::StringComparison comparison_type)
 
static int Compare (const String &strA, int indexA, const String &strB, int indexB, int length, System::StringComparison comparison_type)
 
static int Compare (const String &strA, const String &strB, bool ignoreCase=false)
 
static int Compare (const String &strA, const String &strB, bool ignoreCase, const SharedPtr< System::Globalization::CultureInfo > &ci)
 
static int CompareOrdinal (const String &strA, const String &strB)
 
static int CompareOrdinal (const String &strA, int indexA, const String &strB, int indexB, int length)
 
static String Join (const String &separator, const ArrayPtr< String > &parts, int startIndex=0, int count=-1)
 
static String Concat (const ArrayPtr< String > &parts)
 
static String Concat (const String &str0, const String &str1)
 
static String Concat (const String &str0, const String &str1, const String &str2)
 
static String Copy (const String &str)
 
template<class... Args>
static String Format (const SharedPtr< IFormatProvider > &fp, const String &format, const Args &... args)
 
template<class... Args>
static String Format (const String &format, const Args &... args)
 
template<class T >
static String Format (const String &format, const System::ArrayPtr< System::SharedPtr< T >> &args)
 
static String FromUtf8 (const char *utf8)
 
static String FromUtf8 (const char *utf8, int len)
 
static String FromUtf8 (const uint8_t *utf8)
 
static String FromUtf8 (const std::string &utf8)
 
static String FromWCS (const std::wstring &wcs)
 
static String FromUtf32 (const uint32_t *utf32, int32_t length)
 
static String FromUtf16 (const std::u16string &u16str)
 

Static Public Attributes

static const ASPOSECPP_SHARED_API String Empty
 Empty string. More...
 

Protected Member Functions

StringAppend (const char16_t *src, int32_t startIndex, int32_t count)
 

Protected Attributes

Detail::UnicodeStringHolder m_str
 Actual string value. More...
 
bool m_is_null
 If true, string is considered null string. More...
 

Detailed Description

String class used across the library. Is a substitute for C# System.String when porting code. For optimization reasons, isn't considered an Object subclass. This type should be allocated on stack and passed to functions by value or by reference. Never use System::SmartPtr class to manage objects of this type.

Member Typedef Documentation

◆ reverse_iterator

using System::String::reverse_iterator = std::reverse_iterator<const char16_t*>

Reverse iterator type.

Constructor & Destructor Documentation

◆ String() [1/20]

System::String::String ( )

Default constructor. Creates string object which is considered null.

◆ String() [2/20]

template<typename T >
System::String::String ( T &  value,
typename std::enable_if< IsNonConstStringArray< T, char16_t >::value >::type *  = nullptr 
)
inline

Constructs string based on character array. Treats array as null-terminated string, calculates target string length based on array size.

Parameters
valueCharacter array pointer.

◆ String() [3/20]

template<typename T >
System::String::String ( T &  value,
typename std::enable_if< IsStringLiteral< T, char16_t >::value >::type *  = nullptr 
)
inline

Constructs string based on string literal. Considers literal a null-terminated string, calculates target string length based on literal size.

Parameters
valueString literal pointer.

◆ String() [4/20]

template<typename T >
System::String::String ( const T &  value,
typename std::enable_if< IsStringPointer< T, char16_t >::value >::type *  = nullptr 
)
inline

Constructs string based on character string pointer. Treats pointed string as null-terminated, calculates target string length based on null character.

Parameters
valueCharacter string pointer.

◆ String() [5/20]

System::String::String ( const char16_t *  str,
int  length 
)

Constructs string from character string pointer and explicit length.

Parameters
strString pointer, may be literal or array.
lengthExplicit string length

◆ String() [6/20]

System::String::String ( const char16_t  ch,
int  count 
)
explicit

Fill constructor.

Parameters
chFill character.
countTarget length.

◆ String() [7/20]

template<typename T >
System::String::String ( const T &  value,
typename std::enable_if< std::is_same< T, std::nullptr_t >::value >::type *  = nullptr 
)
inline

Nullptr constructor. Declared as template to resolve priorities with other template constructors.

Template Parameters
TShould be nullptr_t
Parameters
valuenullptr

◆ String() [8/20]

template<typename T >
System::String::String ( T &  value,
typename std::enable_if< IsNonConstStringArray< T, wchar_t >::value >::type *  = nullptr 
)
inlineexplicit

Constructs string based on widecharacter array. Treats array as null-terminated string, calculates target string length based on array size. Conversion from wchar_t is time-consuming on some platforms, so no implicit conversions are allowed.

Parameters
valueCharacter array pointer.

◆ String() [9/20]

template<typename T >
System::String::String ( T &  value,
typename std::enable_if< IsStringLiteral< T, wchar_t >::value >::type *  = nullptr 
)
inlineexplicit

Constructs string based on widestring literal. Considers literal a null-terminated string, calculates target string length based on literal size. Conversion from wchar_t is time-consuming on some platforms, so no implicit conversions are allowed.

Parameters
valueString literal pointer.

◆ String() [10/20]

template<typename T >
System::String::String ( const T &  value,
typename std::enable_if< IsStringPointer< T, wchar_t >::value >::type *  = nullptr 
)
inlineexplicit

Constructs string based on widecharacter string pointer. Treats pointed string as null-terminated, calculates target string length based on null character. Conversion from wchar_t is time-consuming on some platforms, so no implicit conversions are allowed.

Parameters
valueCharacter string pointer.

◆ String() [11/20]

System::String::String ( const wchar_t *  str,
int  length 
)
explicit

Constructs string from widecharacter string pointer and explicit length. Conversion from wchar_t is time-consuming on some platforms, so no implicit conversions are allowed.

Parameters
strString pointer, may be literal or array.
lengthExplicit string length

◆ String() [12/20]

System::String::String ( const wchar_t  ch,
int  count = 1 
)
explicit

Fill constructor. Conversion from wchar_t is time-consuming on some platforms, so no implicit conversions are allowed.

Parameters
chFill character.
countTarget length.

◆ String() [13/20]

System::String::String ( const String str)

Copy constructor.

Parameters
strString to copy.

◆ String() [14/20]

System::String::String ( String &&  str)
noexcept

Move constructor.

Parameters
strString to move data from.

◆ String() [15/20]

System::String::String ( const ArrayPtr< char16_t > &  arr)

Converts whole character array to string.

Parameters
arrArray to convert to string.

◆ String() [16/20]

System::String::String ( const ArrayPtr< char16_t > &  arr,
int  offset,
int  len 
)

Converts character array subrange to string. If parameters are out of array bounds, empty string is constructed.

Parameters
arrCharacter array.
offsetSubarray start index.
lenSubarray length.

◆ ~String()

System::String::~String ( )

Destructor.

◆ String() [17/20]

System::String::String ( const icu::UnicodeString &  str)
explicit

Wraps UnicodeString into String.

Parameters
strUnicodeString to wrap into String.

◆ String() [18/20]

System::String::String ( icu::UnicodeString &&  str)
explicitnoexcept

Move constructor.

Parameters
strUnicodeString to wrap into String.

◆ String() [19/20]

System::String::String ( const std::wstring &  str)
inlineexplicit

Creates String from widestring.

Parameters
strWidestring to convert into String.

◆ String() [20/20]

System::String::String ( const std::u16string &  str)
inlineexplicit

Creates String from utf16 string.

Parameters
strUtf16 string to convert into String.

Member Function Documentation

◆ Append()

String& System::String::Append ( const char16_t *  src,
int32_t  startIndex,
int32_t  count 
)
protected

Puts some characters into string. Changes string size.

Parameters
srcPointer to string to insert.
startIndexIndex to start insertion at.
countNumber of characters to insert.

◆ begin()

const UChar* System::String::begin ( ) const

Returns pointer to the beginning of actual string buffer. Never reallocates anything. Doesn't guarantee buffer to be null-terminated.

Returns
Pointer to actual string buffer, null-terminated or not.

◆ Clone()

String System::String::Clone ( ) const

Creates a copy of current string.

Returns
Full copy of current string which is never null.

◆ Compare() [1/6]

static int System::String::Compare ( const String strA,
int  indexA,
const String strB,
int  indexB,
int  length,
bool  ignoreCase = false 
)
static

Less-equal-greater-compares two substrings.

Parameters
strAFirst string to compare.
indexABeginning of first string substring.
strBSecond string to compare.
indexBBeginning of the second string substring.
lengthNumber of characters to compare.
ignoreCaseSpecifies whether comparison is case-insensitive.
Returns
Negative value if first substring is less then second, zero if they match, positive value otherwise.

◆ Compare() [2/6]

static int System::String::Compare ( const String strA,
int  indexA,
const String strB,
int  indexB,
int  length,
bool  ignoreCase,
const SharedPtr< System::Globalization::CultureInfo > &  ci 
)
static

Less-equal-greater-compares two substrings.

Parameters
strAFirst string to compare.
indexABeginning of first string substring.
strBSecond string to compare.
indexBBeginning of the second string substring.
lengthNumber of characters to compare.
ignoreCaseSpecifies whether comparison is case-insensitive.
ciCulture to use for comparison.
Returns
Negative value if first substring is less then second, zero if they match, positive value otherwise.

◆ Compare() [3/6]

static int System::String::Compare ( const String strA,
const String strB,
System::StringComparison  comparison_type 
)
static

Less-equal-greater-compares two strings.

Parameters
strAFirst string to compare.
strBSecond string to compare.
comparison_typeComparison mode.
Returns
Negative value if first substring is less then second, zero if they match, positive value otherwise.

◆ Compare() [4/6]

static int System::String::Compare ( const String strA,
int  indexA,
const String strB,
int  indexB,
int  length,
System::StringComparison  comparison_type 
)
static

Less-equal-greater-compares two strings.

Parameters
strAFirst string to compare.
indexABeginning of first string substring.
strBSecond string to compare.
indexBBeginning of the second string substring.
lengthNumber of characters to compare.
comparison_typeComparison mode.
Returns
Negative value if first substring is less then second, zero if they match, positive value otherwise.

◆ Compare() [5/6]

static int System::String::Compare ( const String strA,
const String strB,
bool  ignoreCase = false 
)
static

Less-equal-greater-compares two strings.

Parameters
strAFirst string to compare.
strBSecond string to compare.
ignoreCaseSpecifies whether comparison is case-insensitive.
Returns
Negative value if first substring is less then second, zero if they match, positive value otherwise.

◆ Compare() [6/6]

static int System::String::Compare ( const String strA,
const String strB,
bool  ignoreCase,
const SharedPtr< System::Globalization::CultureInfo > &  ci 
)
static

Less-equal-greater-compares two strings.

Parameters
strAFirst string to compare.
strBSecond string to compare.
ignoreCaseSpecifies whether comparison is case-insensitive.
ciCulture to use for comparison.
Returns
Negative value if first substring is less then second, zero if they match, positive value otherwise.

◆ CompareOrdinal() [1/2]

static int System::String::CompareOrdinal ( const String strA,
const String strB 
)
static

Less-equal-greater-compares two strings using ordinal mode.

Parameters
strAFirst string to compare.
strBSecond string to compare.
Returns
Negative value if first substring is less then second, zero if they match, positive value otherwise.

◆ CompareOrdinal() [2/2]

static int System::String::CompareOrdinal ( const String strA,
int  indexA,
const String strB,
int  indexB,
int  length 
)
static

Less-equal-greater-compares two strings using ordinal mode.

Parameters
strAFirst string to compare.
indexABeginning of first string substring.
strBSecond string to compare.
indexBBeginning of the second string substring.
lengthNumber of characters to compare.
Returns
Negative value if first substring is less then second, zero if they match, positive value otherwise.

◆ CompareTo()

int System::String::CompareTo ( const String str) const

Compares two strings in 'less-equals-more' style. Uses current culture.

Parameters
strString to compare this to.
Returns
Negative value if this is considered lower than str, zero if they match, positive value if this is greater than str.

◆ Concat() [1/3]

static String System::String::Concat ( const ArrayPtr< String > &  parts)
static

Concatenates strings.

Parameters
partsStrings to concatenate.
Returns
String containing concatenated strings.

◆ Concat() [2/3]

static String System::String::Concat ( const String str0,
const String str1 
)
static

Concatenates strings.

Parameters
str0First string to concatenate.
str1Second string to concatenate.
Returns
String containing concatenated strings.

◆ Concat() [3/3]

static String System::String::Concat ( const String str0,
const String str1,
const String str2 
)
static

Concatenates strings.

Parameters
str0First string to concatenate.
str1Second string to concatenate.
str2Third string to concatenate.
Returns
String containing concatenated strings.

◆ Contains()

bool System::String::Contains ( const String str) const

Checks if str is a substring of current string.

Parameters
strLookup string.
Returns
true if substring is present, false otherwise.

◆ Copy()

static String System::String::Copy ( const String str)
inlinestatic

Creates string copy.

Parameters
strString to copy.
Returns
Copy of passed string.

◆ CopyTo()

void System::String::CopyTo ( int  sourceIndex,
const ArrayPtr< char_t > &  destination,
int  destinationIndex,
int  count 
) const

Copies string characters into existing array elements. No resize is being done.

Parameters
sourceIndexIn-string index to start reading from.
destinationDestination array.
destinationIndexIn-array index to start writing from.
countNumber of characters to copy.

◆ end()

const UChar* System::String::end ( ) const

Returns pointer to the end of actual string buffer. Never reallocates anything. Doesn't guarantee buffer to be null-terminated.

Returns
Pointer to the first element after actual string buffer, null-terminated or not.

◆ EndsWith() [1/2]

bool System::String::EndsWith ( const String value,
System::StringComparison  comparisonType 
) const

Checks if string ends with specified substring.

Parameters
valueLookup string.
comparisonTypeComparison mode, see System::StringComparison for details.
Returns
true if string ends with specified substring, false otherwise.

◆ EndsWith() [2/2]

bool System::String::EndsWith ( const String value,
bool  ignoreCase = false,
const SharedPtr< System::Globalization::CultureInfo > &  culture = nullptr 
) const

Checks if string ends with specified substring.

Parameters
valueLookup string.
ignoreCaseSpecifies whether comparison is case-insensitive.
cultureCulture to use while performing string comparison.
Returns
true if string ends with specified substring, false otherwise.

◆ Equals() [1/4]

bool System::String::Equals ( const String str,
System::StringComparison  comparison_type 
) const

String equality comparison. Several modes provided by StringComparison enumeration are supported.

Parameters
strString to compare against the current one.
comparison_typeComparison mode (see System::StringComparison for details).
Returns
true if strings match using selected comparison type, false otherwise.

◆ Equals() [2/4]

bool System::String::Equals ( const String str) const

String equality comparison. Uses System::StringComparison::Ordinal comparison mode.

Parameters
strString to compare against the current one.
Returns
true if strings match, false otherwise.

◆ Equals() [3/4]

static bool System::String::Equals ( const String strA,
const String strB 
)
static

Equal-compares two strings using Ordial comparison mode.

Parameters
strAFirst string to compare.
strBSecond string to compare.
Returns
true if strings match, false otherwise.

◆ Equals() [4/4]

static bool System::String::Equals ( const String strA,
const String strB,
System::StringComparison  comparison_type 
)
static

Equal-compares two strings.

Parameters
strAFirst string to compare.
strBSecond string to compare.
comparison_typeComparison mode.
Returns
true if strings match, false otherwise.

◆ FastToAscii()

int System::String::FastToAscii ( char  buffer[],
int  buffer_size 
) const

Tries to convert a String to an ASCII string.

Parameters
bufferA buffer to store the resulting string.
buffer_sizeBuffer's size.
Returns
The resulting string length or -1 if a String is not an ASCII string.

◆ Format() [1/3]

template<class... Args>
static String System::String::Format ( const SharedPtr< IFormatProvider > &  fp,
const String format,
const Args &...  args 
)
inlinestatic

Formats string in C# style.

Template Parameters
ArgsArguments to format string.
Parameters
fpFormat provider to use to convert arguments to strings.
formatFormat string.
argsArguments to format string.

◆ Format() [2/3]

template<class... Args>
static String System::String::Format ( const String format,
const Args &...  args 
)
inlinestatic

Formats string in C# style.

Template Parameters
ArgsArguments to format string.
Parameters
formatFormat string.
argsArguments to format string.

◆ Format() [3/3]

template<class T >
static String System::String::Format ( const String format,
const System::ArrayPtr< System::SharedPtr< T >> &  args 
)
inlinestatic

Formats string in C# style.

Template Parameters
TArguments to format string.
Parameters
formatFormat string.
argsArguments to format string.

◆ FromUtf16()

static String System::String::FromUtf16 ( const std::u16string &  u16str)
static

Creates String from utf16 string.

Parameters
u16strUtf16 string.
Returns
String object representing passed string.

◆ FromUtf32()

static String System::String::FromUtf32 ( const uint32_t *  utf32,
int32_t  length 
)
static

Creates String from utf32 string.

Parameters
utf32Pointer to string encoded in utf32.
lengthNumber of characters to convert.
Returns
String object representing passed string.

◆ FromUtf8() [1/4]

static String System::String::FromUtf8 ( const char *  utf8)
static

Creates String from utf8 string.

Parameters
utf8Pointer to null-terminated string encoded using utf8 codepage.
Returns
String object representing passed string.

◆ FromUtf8() [2/4]

static String System::String::FromUtf8 ( const char *  utf8,
int  len 
)
static

Creates String from utf8 string.

Parameters
utf8Pointer to string encoded using utf8 codepage.
lenNumber of characters to handle.
Returns
String object representing passed string.

◆ FromUtf8() [3/4]

static String System::String::FromUtf8 ( const uint8_t *  utf8)
static

Creates String from utf8 string.

Parameters
utf8Pointer to null-terminated string encoded using utf8 codepage.
Returns
String object representing passed string.

◆ FromUtf8() [4/4]

static String System::String::FromUtf8 ( const std::string &  utf8)
static

Creates String from utf8 string.

Parameters
utf8Pointer to string encoded using utf8 codepage.
Returns
String object representing passed string.

◆ FromWCS()

static String System::String::FromWCS ( const std::wstring &  wcs)
static

Creates String from widestring.

Parameters
wcsWidestring to convert into String.
Returns
String object representing passed string.

◆ get_Length()

int System::String::get_Length ( ) const

Gets string length.

Returns
Length of contained string.

◆ GetHashCode()

int System::String::GetHashCode ( ) const

Hashes contained string. Implemented in ICU, doesn't match hashes in C#.

Returns
Calculated hash code value.

◆ IndexOf() [1/7]

int System::String::IndexOf ( const String str,
System::StringComparison  comparison_type 
) const

Substring forward lookup.

Parameters
strSubstring to look for.
comparison_typeComparison mode.
Returns
Index of first found substring or -1 if not found. For empty lookup string, always returns 0.

◆ IndexOf() [2/7]

int System::String::IndexOf ( char_t  c,
int  startIndex = 0 
) const

Character forward lookup.

Parameters
cCharacter to look for.
startIndexIndex to start lookup at.
Returns
Index of first character position since startIndex or -1 if not found.

◆ IndexOf() [3/7]

int System::String::IndexOf ( char_t  c,
int  startIndex,
int  count 
) const

Character forward lookup in substring.

Parameters
cCharacter to look for.
startIndexIndex to start lookup at.
countNumber of characters to look through.
Returns
Index of first character position since startIndex or -1 if not found.

◆ IndexOf() [4/7]

int System::String::IndexOf ( const String str,
int  startIndex = 0 
) const

Substring forward lookup.

Parameters
strSubstring to look for.
startIndexPosition in source string to start lookup through.
Returns
Index of first found substring or -1 if not found. For empty lookup string, always returns startIndex.

◆ IndexOf() [5/7]

int System::String::IndexOf ( const String str,
int  startIndex,
System::StringComparison  comparison_type 
) const

Substring forward lookup.

Parameters
strSubstring to look for.
startIndexPosition in source string to start lookup through.
comparison_typeComparison mode.
Returns
Index of first found substring or -1 if not found. For empty lookup string, always returns startIndex.

◆ IndexOf() [6/7]

int System::String::IndexOf ( const String value,
int  startIndex,
int  count,
System::StringComparison  comparisonType 
) const

Substring forward lookup.

Parameters
valueSubstring to look for.
startIndexPosition in source string to start lookup through.
countnumber of characters to look through.
comparisonTypeComparison mode.
Returns
Index of first found substring or -1 if not found. For empty lookup string, always returns startIndex.

◆ IndexOf() [7/7]

int System::String::IndexOf ( const String str,
int  startIndex,
int  count 
) const

Substring forward lookup.

Parameters
strSubstring to look for.
startIndexPosition in source string to start lookup through.
countnumber of characters to look through.
Returns
Index of first found substring or -1 if not found. For empty lookup string, always returns startIndex.

◆ IndexOfAny() [1/5]

int System::String::IndexOfAny ( char_t  c,
int  startIndex = 0 
) const

Character forward lookup.

Parameters
cCharacter to look for.
startIndexIndex to start lookup at.
Returns
Index of first character position since startIndex or -1 if not found.

◆ IndexOfAny() [2/5]

int System::String::IndexOfAny ( const String str,
int  startIndex = 0 
) const

Consequently looks for all characters of str in this. If first character is found, its position is returned, otherwise looks for the second one and so on.

Parameters
strString of characters to look for. Order of characters matters.
startIndexPosition to start lookup from.
Returns
Index of first found character or -1 if none is found.

◆ IndexOfAny() [3/5]

int System::String::IndexOfAny ( const ArrayPtr< char_t > &  anyOf) const

Looks for any of passed characters through the whole string. Compares first string character to all characters in anyOf, then compares second one and so on. Returns index of the first one matching any of the target characters.

Parameters
anyOfArray of characters to look for. Order doesn't matter.
Returns
Index of the first matching character or -1 if not found.

◆ IndexOfAny() [4/5]

int System::String::IndexOfAny ( const ArrayPtr< char_t > &  anyOf,
int32_t  startindex 
) const

Looks for any of passed characters through substring. Compares first string character to all characters in anyOf, then compares second one and so on. Returns index of the first one matching any of the target characters.

Parameters
anyOfArray of characters to look for. Order doesn't matter.
startindexIndex to start lookup from.
Returns
Index of the first matching character or -1 if not found.

◆ IndexOfAny() [5/5]

int System::String::IndexOfAny ( const ArrayPtr< char_t > &  anyOf,
int32_t  startindex,
int32_t  count 
) const

Looks for any of passed characters through substring. Compares first string character to all characters in anyOf, then compares second one and so on. Returns index of the first one matching any of the target characters.

Parameters
anyOfArray of characters to look for. Order doesn't matter.
startindexIndex to start lookup from.
countNumber of characters to look through.
Returns
Index of the first matching character or -1 if not found.

◆ Insert()

String System::String::Insert ( int  startIndex,
const String value 
) const

Inserts substring at specified position

Parameters
startIndexIndex in this string to start inserting from.
valueInsertion string.
Returns
String with insertion done.

◆ Is()

bool System::String::Is ( const System::TypeInfo target) const
inline

Checks if string object is of type specified by TypeInfo passed.

Parameters
targetTypeInfo to check against.
Returns
true if target is TypeInfo of String class, false otherwise.

◆ IsAsciiString()

bool System::String::IsAsciiString ( ) const

Indicates if a String contains ASCII symbols only.

Returns
True if a string is an ASCII string.

◆ IsEmpty()

bool System::String::IsEmpty ( ) const

Checks if string is both non-null and empty.

Returns
true if string is empty and not null, false otherwise.

◆ IsNormalized()

bool System::String::IsNormalized ( System::Text::NormalizationForm  form) const

Checks if unicode string is normalized using normalization form specified.

Parameters
formNormalization form, see System::Text::NormalizationForm for details.
Returns
true if string is already normalized, false otherwise.

◆ IsNull()

bool System::String::IsNull ( ) const
inline

Checks if string is considered null. String is null and only if it is constructed via String() constructor, moved, copied or assigned from null string or reset() method was called.

Returns
true if string is considered null, false otherwise.

◆ IsNullOrEmpty() [1/2]

bool System::String::IsNullOrEmpty ( ) const

Checks if string is empty or is considered null.

Returns
true if string is empty or null, false otherwise.

◆ IsNullOrEmpty() [2/2]

static bool System::String::IsNullOrEmpty ( const String str)
static

Checks if passed string is null or empty.

Parameters
strString to check.
Returns
true if string is null or empty, false otherwise.

◆ Join()

static String System::String::Join ( const String separator,
const ArrayPtr< String > &  parts,
int  startIndex = 0,
int  count = -1 
)
static

Joins array using string as separator.

Parameters
separatorString to put between array elements when joining them.
partsArray of parts to join.
startIndexFirst index in array to start joining from.
countNumber of array elements to join. -1 means 'until array ends'.
Returns
String representing joint array elements.

◆ LastIndexOf() [1/6]

int System::String::LastIndexOf ( const String str,
int  startIndex = INT32_MAX 
) const

Substring backward lookup.

Parameters
strSubstring to look for.
startIndexPosition in source string to start lookup through.
Returns
Index of last found substring or -1 if not found. For empty lookup string, always returns string length.

◆ LastIndexOf() [2/6]

int System::String::LastIndexOf ( const String str,
System::StringComparison  comparison_type 
) const

Substring backward lookup.

Parameters
strSubstring to look for.
comparison_typeComparison mode.
Returns
Index of last found substring or -1 if not found. For empty lookup string, always returns string length.

◆ LastIndexOf() [3/6]

int System::String::LastIndexOf ( const String value,
int  startIndex,
int  count,
StringComparison  comparisonType 
) const

Substring backward lookup.

Parameters
valueSubstring to look for.
startIndexPosition in source string to start lookup through.
countNumber of characters to look through.
comparisonTypeComparison mode.
Returns
Index of last found substring or -1 if not found. For empty lookup string, always returns startIndex+count.

◆ LastIndexOf() [4/6]

int System::String::LastIndexOf ( char_t  value) const

Character backward lookup.

Parameters
valueCharacter to look for.
Returns
Index of last character position or -1 if not found.

◆ LastIndexOf() [5/6]

int System::String::LastIndexOf ( char_t  value,
int32_t  startIndex 
) const

Character backward lookup.

Parameters
valueCharacter to look for.
startIndexIndex to start lookup at.
Returns
Index of last character position since startIndex or -1 if not found.

◆ LastIndexOf() [6/6]

int System::String::LastIndexOf ( char_t  value,
int32_t  startIndex,
int32_t  count 
) const

Character backward lookup.

Parameters
valueCharacter to look for.
startIndexIndex to start lookup at.
countNumber of characters to look through
Returns
Index of last character position since startIndex or -1 if not found.

◆ LastIndexOfAny() [1/3]

int System::String::LastIndexOfAny ( const ArrayPtr< char_t > &  anyOf) const

Looks for any of passed characters through whole string backwardly. Compares last string character to all characters in anyOf, then compares previous one and so on. Returns index of the first match found.

Parameters
anyOfArray of characters to look for. Order doesn't matter.
Returns
Index of the last matching character or -1 if not found.

◆ LastIndexOfAny() [2/3]

int System::String::LastIndexOfAny ( const ArrayPtr< char_t > &  anyOf,
int32_t  startindex 
) const

Looks for any of passed characters through substring backwardly. Compares last string character to all characters in anyOf, then compares previous one and so on. Returns index of the first match found.

Parameters
anyOfArray of characters to look for. Order doesn't matter.
startindexIndex to start lookup from.
Returns
Index of the last matching character or -1 if not found.

◆ LastIndexOfAny() [3/3]

int System::String::LastIndexOfAny ( const ArrayPtr< char_t > &  anyOf,
int32_t  startindex,
int32_t  count 
) const

Looks for any of passed characters through substring backwardly. Compares last string character to all characters in anyOf, then compares previous one and so on. Returns index of the first match found.

Parameters
anyOfArray of characters to look for. Order doesn't matter.
startindexIndex to start lookup from.
countNumber of characters to look through.
Returns
Index of the last matching character or -1 if not found.

◆ Normalize()

String System::String::Normalize ( System::Text::NormalizationForm  form) const

Normalizes unicode string using normalization form specified.

Parameters
formNormalization form, see System::Text::NormalizationForm for details.
Returns
Normalized string.

◆ operator!=() [1/2]

bool System::String::operator!= ( const String str) const

Non-equality comparison operator.

Parameters
strString to compare current one to.
Returns
false if both strings are null or both are not null and match, true otherwise.

◆ operator!=() [2/2]

bool System::String::operator!= ( std::nullptr_t  ) const

Checks if string is not null. Applies same logic as IsNull() call.

Returns
false if string is null, true otherwise.

◆ operator+() [1/9]

String System::String::operator+ ( const String str) const

String concatenation operator.

Parameters
strString to add to the end of current one.
Returns
Concatenated string.

◆ operator+() [2/9]

template<typename T >
std::enable_if<IsStringLiteral<T, char_t>::value, String>::type System::String::operator+ ( const T &  arg) const
inline

String concatenation with string literal or character string pointer.

Template Parameters
TOne of string literal or character string pointer forms.
Parameters
argEntity to concatenate with current string.
Returns
Concatenated string.

◆ operator+() [3/9]

String System::String::operator+ ( char_t  x) const

Adds character to the end of the string.

Parameters
xCharacter to add.
Returns
String concatenation result.

◆ operator+() [4/9]

String System::String::operator+ ( int  i) const

Adds integer value string representation to the end of the string.

Parameters
iInteger value to convert to string and to add.
Returns
String concatenation result.

◆ operator+() [5/9]

String System::String::operator+ ( uint32_t  i) const

Adds unsigned integer value string representation to the end of the string.

Parameters
iValue to convert to string and to add.
Returns
String concatenation result.

◆ operator+() [6/9]

String System::String::operator+ ( double  d) const

Adds floating point value string representation to the end of the string.

Parameters
dValue to convert to string and to add.
Returns
String concatenation result.

◆ operator+() [7/9]

String System::String::operator+ ( int64_t  v) const

Adds integer value string representation to the end of the string.

Parameters
vValue to convert to string and to add to add.
Returns
String concatenation result.

◆ operator+() [8/9]

template<typename T >
std::enable_if<IsSmartPtr<T>::value, String>::type System::String::operator+ ( const T &  value) const
inline

Adds reference type object string representation to the end of the string.

Template Parameters
Tpointer type.
Parameters
valueObject to convert to string using ToString() call and to add to current string.
Returns
String concatenation result.

◆ operator+() [9/9]

template<typename T >
std::enable_if<!IsSmartPtr<T>::value && !std::is_scalar<T>::value && !std::is_array<T>::value, String>::type System::String::operator+ ( const T &  value) const
inline

Adds value type object string representation to the end of the string.

Template Parameters
TValue type to call ToString() upon.
Parameters
valueObject to convert to string using ToString() call and to add to current string.
Returns
String concatenation result.

◆ operator+=() [1/2]

String& System::String::operator+= ( char_t  c)

Concatenation assignment operator.

Parameters
cCharacter to add to the end of current string.
Returns
self reference.

◆ operator+=() [2/2]

String& System::String::operator+= ( const String str)

Concatenation assignment operator.

Parameters
strString to add to the end of current string.
Returns
self reference.

◆ operator<>

bool System::String::operator< ( const String str) const

Order-compares strings.

Parameters
strString to compare current one to.
Returns
true if this is considering less than str, false otherwise.

◆ operator=() [1/2]

String& System::String::operator= ( const String str)

Assignment operator.

Parameters
strString to copy.
Returns
Self reference.

◆ operator=() [2/2]

String& System::String::operator= ( String &&  str)
noexcept

Move assignment operator.

Parameters
strString to move data from.
Returns
Self reference.

◆ operator==() [1/2]

bool System::String::operator== ( const String str) const

Equality comparison operator.

Parameters
strString to compare current one to.
Returns
true if both strings are null or both are not null and match, false otherwise.

◆ operator==() [2/2]

bool System::String::operator== ( std::nullptr_t  ) const

Checks if string is null. Applies same logic as IsNull() call.

Returns
true if string is null, false otherwise.

◆ operator[]()

char_t System::String::operator[] ( int  index) const

Gets character at specified position.

Parameters
indexIndex to get character from.
Returns
Character at specified position or 0xffff if out of bounds.

◆ PadLeft()

String System::String::PadLeft ( int  totalWidth,
char_t  c = u' ' 
) const

Adds padding on the left of original string.

Parameters
totalWidthNumber of pading characters to insert.
cPadding character.
Returns
String with padding inserted.

◆ PadRight()

String System::String::PadRight ( int  totalWidth,
char_t  c = u' ' 
) const

Adds padding on the right of original string.

Parameters
totalWidthNumber of pading characters to insert.
cPadding character.
Returns
String with padding inserted.

◆ rbegin()

reverse_iterator System::String::rbegin ( ) const

Returns reverse iterator to the last character (if any) of actual string buffer.

Returns
Reverse iterator to the last character of actual string buffer (if any) or same as rend().

◆ Remove()

String System::String::Remove ( int32_t  startIndex,
int32_t  count = INT32_MAX 
) const

Extracts everything but substring from current string.

Parameters
startIndexIndex of first character to not extract.
countNumber of characters to not extract.
Returns
String around specified substring.

◆ rend()

reverse_iterator System::String::rend ( ) const

Returns reverse iterator to the before first character (if any) of actual string buffer.

Returns
Reverse iterator to the element preceeding first character of actual string buffer (if any) or to element just before allocated buffer.

◆ Replace() [1/2]

String System::String::Replace ( char_t  oldValue,
char_t  newValue 
) const

Replaces all occurrances of character in the string.

Parameters
oldValueCharacter to replace.
newValuereplacement value.
Returns
String with replacement done.

◆ Replace() [2/2]

String System::String::Replace ( const String oldValue,
const String newValue 
) const

Replaces all occurrances of lookup in this string.

Parameters
oldValueString to replace.
newValuereplacement string.
Returns
String with replacement done.

◆ reset()

String& System::String::reset ( )

Sets string to null. Is analogous to 'string_variable_name = null' in C#.

Returns
Self reference.

◆ SetCharAt()

String& System::String::SetCharAt ( int  index,
char_t  ch 
)

Sets character at specified position.

Parameters
indexIndex to set character at.
chCharacter to put at specified position.
Returns
Self reference.

◆ Split() [1/9]

ArrayPtr<String> System::String::Split ( char_t  separator = u' ',
StringSplitOptions  opt = StringSplitOptions::None 
) const

Splits string by character.

Parameters
separatorCharacter to split string by.
optSplitting options.
Returns
Array of substrings.

◆ Split() [2/9]

ArrayPtr<String> System::String::Split ( char_t  separator,
int32_t  count,
StringSplitOptions  opt = StringSplitOptions::None 
) const

Splits string by character.

Parameters
separatorCharacter to split string by.
countThe maximum number of substrings to return.
optSplitting options.
Returns
Array of substrings.

◆ Split() [3/9]

ArrayPtr<String> System::String::Split ( char_t  separatorA,
char_t  separatorB,
StringSplitOptions  opt = StringSplitOptions::None 
) const

Splits string by one of two characters.

Parameters
separatorAFirst character to split string by.
separatorBSecond character to split string by.
optSplitting options.
Returns
Array of substrings.

◆ Split() [4/9]

ArrayPtr<String> System::String::Split ( const ArrayPtr< char_t > &  separators,
StringSplitOptions  opt = StringSplitOptions::None 
) const

Splits string by one of characters specified.

Parameters
separatorsArray of separator characters. If empty, any whitespace character is considered a separator.
optSplitting options.
Returns
Array of substrings.

◆ Split() [5/9]

ArrayPtr<String> System::String::Split ( const ArrayPtr< char_t > &  separators,
int32_t  count,
StringSplitOptions  opt = StringSplitOptions::None 
) const

Splits string by one of characters specified.

Parameters
separatorsArray of separator characters. If empty, any whitespace character is considered a separator.
countThe maximum number of substrings to return.
optSplitting options.
Returns
Array of substrings.

◆ Split() [6/9]

ArrayPtr<String> System::String::Split ( const String separator,
StringSplitOptions  opt = StringSplitOptions::None 
) const

Splits string by substring.

Parameters
separatorSubstring acting as separator. If empty, whitespace character acts as separator.
optSplitting options.
Returns
Array of substrings.

◆ Split() [7/9]

ArrayPtr<String> System::String::Split ( const String separator,
int  count,
StringSplitOptions  opt = StringSplitOptions::None 
) const

Splits string by substring.

Parameters
separatorSubstring acting as separator. If empty, whitespace character acts as separator.
countMax number of elements in splits array.
optSplitting options.
Returns
Array of substrings.

◆ Split() [8/9]

ArrayPtr<String> System::String::Split ( const ArrayPtr< String > &  separators,
StringSplitOptions  opt = StringSplitOptions::None 
) const

Splits string by substring.

Parameters
separatorsArray of separator strings. If empty, no splitting is done.
optSplitting options.
Returns
Array of substrings.

◆ Split() [9/9]

ArrayPtr<String> System::String::Split ( const ArrayPtr< String > &  separators,
int  count,
StringSplitOptions  opt = StringSplitOptions::None 
) const

Splits string by substring. Currently, only supports separators array of zero or one elements.

Parameters
separatorsArray of separator strings. If empty, no splitting is done.
countMax number of elements in splits array.
optSplitting options.
Returns
Array of substrings.

◆ StartsWith() [1/2]

bool System::String::StartsWith ( const String value,
System::StringComparison  comparisonType 
) const

Checks if string begins with specified substring.

Parameters
valueLookup string.
comparisonTypeComparison mode, see System::StringComparison for details.
Returns
true if string starts with specified substring, false otherwise.

◆ StartsWith() [2/2]

bool System::String::StartsWith ( const String value,
bool  ignoreCase = false,
const SharedPtr< System::Globalization::CultureInfo > &  culture = nullptr 
) const

Checks if string begins with specified substring.

Parameters
valueLookup string.
ignoreCaseSpecifies whether comparison is case-insensitive.
cultureCulture to use while performing string comparison.
Returns
true if string starts with specified substring, false otherwise.

◆ Substring()

String System::String::Substring ( int32_t  startIndex,
int32_t  length = INT32_MAX 
) const

Extracts substring.

Parameters
startIndexSubstring start index.
lengthSubstring length.
Returns
Extracted substring.

◆ ToAsciiString()

std::string System::String::ToAsciiString ( ) const

Converts string to std::string. Uses ASCII encoding.

Returns
String representation in Ascii.
Exceptions
FormatExceptionif a string contains non-ASCII characters.

◆ ToByteArray()

ArrayPtr<uint8_t> System::String::ToByteArray ( int32_t  startIndex = 0,
int32_t  length = INT32_MAX,
bool  LE = true 
) const

Converts string or substring to array of bytes.

Parameters
startIndexSubstring start index.
lengthSubstring length.
LEIf true, encode characters using little endianness; otherwise, use big endianness.
Returns
Array containing bytes representing characters of the string.

◆ ToCharArray()

ArrayPtr<char_t> System::String::ToCharArray ( int32_t  startIndex = 0,
int32_t  length = INT32_MAX 
) const

Converts string or substring to array of characters.

Parameters
startIndexSubstring start index.
lengthSubstring length.
Returns
Array containing characters of the string.

◆ ToLower() [1/2]

String System::String::ToLower ( ) const

Converts all string's characters to lower case.

Returns
Converted string.

◆ ToLower() [2/2]

String System::String::ToLower ( const SharedPtr< System::Globalization::CultureInfo > &  cultureInfo) const

Converts all string's characters to lower case using specific culture.

Parameters
cultureInfoCulture to use.
Returns
Converted string.

◆ ToLowerInvariant()

String System::String::ToLowerInvariant ( ) const

Converts all string's characters to lower case using invariant culture.

Returns
Converted string.

◆ ToString() [1/2]

String System::String::ToString ( ) const
inline

Wrapper for handling String class in contexts where ToString() is being called on value type objects.

Returns
Copy of current string. It is considered a null string if current string is a null string.

◆ ToString() [2/2]

String System::String::ToString ( const SharedPtr< IFormatProvider > &  ) const
inline

Wrapper for handling String class in contexts where ToString() is being called on value type objects.

Returns
Copy of current string. It is considered a null string if current string is a null string.

◆ ToU16Str()

std::u16string System::String::ToU16Str ( ) const

Converts string to std::u16string.

Returns
Original string converted to u16string.

◆ ToUpper() [1/2]

String System::String::ToUpper ( ) const

Converts all string's characters to upper case.

Returns
Converted string.

◆ ToUpper() [2/2]

String System::String::ToUpper ( const SharedPtr< System::Globalization::CultureInfo > &  cultureInfo) const

Converts all string's characters to upper case using specific culture.

Parameters
cultureInfoCulture to use.
Returns
Converted string.

◆ ToUpperInvariant()

String System::String::ToUpperInvariant ( ) const

Converts all string's characters to upper case using invariant culture.

Returns
Converted string.

◆ ToUtf8String()

std::string System::String::ToUtf8String ( ) const

Converts string to std::string. Uses UTF-8 encoding.

Returns
String representation in utf-8.

◆ ToWCS()

std::wstring System::String::ToWCS ( ) const

Converts string to std::wstring.

Returns
Original string converted to wstring.

◆ Trim() [1/4]

String System::String::Trim ( ) const

Removes all whitespace characters from both beginning and end of the string.

Returns
String with no whitespaces at beginning or end.

◆ Trim() [2/4]

String System::String::Trim ( char_t  ch) const

Removes all occurrances of passed character from both beginning and end of the string.

Parameters
chSymbol to remove.
Returns
Removal result.

◆ Trim() [3/4]

String System::String::Trim ( const String anyOf) const

Removes all occurrances of passed characters from both beginning and end of the string.

Parameters
anyOfString of characters to remove.
Returns
String without removed characters.

◆ Trim() [4/4]

String System::String::Trim ( const ArrayPtr< char_t > &  anyOf) const

Removes all occurrances of passed characters from both beginning and end of the string.

Parameters
anyOfArray of characters to remove.
Returns
String without removed characters.

◆ TrimEnd() [1/4]

String System::String::TrimEnd ( ) const

Removes all whitespace characters from end of the string.

Returns
String with no whitespaces at beginning.

◆ TrimEnd() [2/4]

String System::String::TrimEnd ( char_t  ch) const

Removes all occurrances of passed character from end of the string.

Parameters
chSymbol to remove.
Returns
Removal result.

◆ TrimEnd() [3/4]

String System::String::TrimEnd ( const String anyOf) const

Removes all occurrances of passed characters from end of the string.

Parameters
anyOfString of characters to remove.
Returns
String without removed characters.

◆ TrimEnd() [4/4]

String System::String::TrimEnd ( const ArrayPtr< char_t > &  anyOf) const

Removes all occurrances of passed characters from end of the string.

Parameters
anyOfArray of characters to remove.
Returns
String without removed characters.

◆ TrimStart() [1/4]

String System::String::TrimStart ( ) const

Removes all whitespace characters from beginning of the string.

Returns
String with no whitespaces at beginning.

◆ TrimStart() [2/4]

String System::String::TrimStart ( char_t  ch) const

Removes all occurrances of passed character from beginning of the string.

Parameters
chSymbol to remove.
Returns
Removal result.

◆ TrimStart() [3/4]

String System::String::TrimStart ( const String anyOf) const

Removes all occurrances of passed characters from beginning of the string.

Parameters
anyOfString of characters to remove.
Returns
String without removed characters.

◆ TrimStart() [4/4]

String System::String::TrimStart ( const ArrayPtr< char_t > &  anyOf) const

Removes all occurrances of passed characters from beginning of the string.

Parameters
anyOfArray of characters to remove.
Returns
String without removed characters.

◆ u_str()

const UChar* System::String::u_str ( ) const

Returns ICU-styled null-terminated buffer. May reallocate the string.

Returns
Pointer to null-terminated string buffer.

Member Data Documentation

◆ Empty

const ASPOSECPP_SHARED_API String System::String::Empty
static

Empty string.

◆ m_is_null

bool System::String::m_is_null
protected

If true, string is considered null string.

◆ m_str

Detail::UnicodeStringHolder System::String::m_str
mutableprotected

Actual string value.