String::CompareOrdinal Method

This topic has not yet been rated - Rate this topic

Compares two String objects by evaluating the numeric values of the corresponding characters in the two string values represented by the objects.


    int CompareOrdinal(
               String^ str1, 
               String^ str2)

str1

The first String object.

str2

The second String object.

An integer that indicates the lexical relationship between the two comparands. The following table lists the possible return values.

Value

Condition

-1

str1 is less than str2.

0

str1 is equals str2.

1

str1 is greater than str2.

Minimum supported client: Windows 8

Minimum supported server: Windows Server 2012

Namespace: Platform

Metadata: vccorlib.h

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.