System::StringComparer class

StringComparer class

Compares strings using different comparison modes. Objects of this class should only be allocated using System::MakeObject() function. Never create instance of this type on stack or using operator new, as it will result in runtime errors and/or assertion faults. Always wrap this class into System::SmartPtr pointer and use this pointer to pass it to functions as argument.

class StringComparer : public virtual System::Object,
                       public System::Collections::Generic::IComparer<String>,
                       public System::Collections::Generic::IEqualityComparer<String>

Methods

MethodDescription
Compare(args_type, args_type) const overrideCompares two strings using current settings.
static Create(const System::SharedPtr<System::Globalization::CultureInfo>&, bool)Creates culture-specific comparer.
Equals(String, String) const overrideChecks if two strings are equal using current settings.
static get_CurrentCulture()Current culture comparer singleton.
static get_CurrentCultureIgnoreCase()Current culture case-ignoring comparer singleton.
static get_InvariantCulture()Invariant culture comparer singleton.
static get_InvariantCultureIgnoreCase()Invariant culture case-ignoring comparer singleton.
static get_Ordinal()Ordinal comparer singleton.
static get_OrdinalIgnoreCase()Ordinal case-ignoring comparer singleton.
GetHashCode(String) const overrideGets string’s hash code.

Typedefs

TypedefDescription
args_typeRTTI information.

See Also