Dela via


HostName.Compare(String, String) Method

Definition

Compares two strings to determine if they represent the same hostname.

public:
 static int Compare(Platform::String ^ value1, Platform::String ^ value2);
 static int Compare(winrt::hstring const& value1, winrt::hstring const& value2);
public static int Compare(string value1, string value2);
function compare(value1, value2)
Public Shared Function Compare (value1 As String, value2 As String) As Integer

Parameters

value1
String

Platform::String

winrt::hstring

A hostname or IP address.

value2
String

Platform::String

winrt::hstring

A hostname or IP address.

Returns

Int32

int

The return value indicates the lexicographic relation of value1 to value2. If the two parameters represent the same canonical hostname, then zero is returned. If value1 is less than value2, the return value is less than zero. If value1 is greater than value2, the return vale is greater than zero.

Remarks

The Compare method is used to compare two strings to determine if the strings represent the same hostname. This method compares canonical names created from the value1 and value2 parameters to determine the value to return.

Applies to

See also