HostName.Compare | compare method

Applies to Windows and Windows Phone

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

Syntax


var number = Windows.Networking.HostName.compare(value1, value2);

Parameters

value1

Type: String [JavaScript] | System.String [.NET] | Platform::String [C++]

A hostname or IP address.

value2

Type: String [JavaScript] | System.String [.NET] | Platform::String [C++]

A hostname or IP address.

Return value

Type: Number [JavaScript] | System.Int32 [.NET] | int32 [C++]

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.

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8

Namespace

Windows.Networking
Windows::Networking [C++]

Metadata

Windows.winmd

DLL

Windows.Networking.dll

See also

HostName
Windows.Networking

 

 

Show:
© 2014 Microsoft