CompareTo()

String::CompareTo(const String&) const method

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

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

Arguments

ParameterTypeDescription
strconst String&String to compare this to.

Return Value

Negative value if this is considered lower than str, zero if they match, positive value if this is greater than str.

See Also