Arrays.Compare Method

Definition

Overloads

Compare(Byte[], Int32, Int32, Byte[], Int32, Int32)

Compares two byte arrays lexicographically over the specified ranges.

Compare(Char[], Int32, Int32, Char[], Int32, Int32)

Compares two char arrays lexicographically over the specified ranges.

Compare(Double[], Int32, Int32, Double[], Int32, Int32)

Compares two double arrays lexicographically over the specified ranges.

Compare(Int16[], Int32, Int32, Int16[], Int32, Int32)

Compares two short arrays lexicographically over the specified ranges.

Compare(Object[], Int32, Int32, Object[], Int32, Int32, IComparator)

Compares two Object arrays lexicographically over the specified ranges.

Compare(Int64[], Int32, Int32, Int64[], Int32, Int32)

Compares two long arrays lexicographically over the specified ranges.

Compare(Single[], Int32, Int32, Single[], Int32, Int32)

Compares two float arrays lexicographically over the specified ranges.

Compare(Boolean[], Int32, Int32, Boolean[], Int32, Int32)

Compares two boolean arrays lexicographically over the specified ranges.

Compare(Int32[], Int32, Int32, Int32[], Int32, Int32)

Compares two int arrays lexicographically over the specified ranges.

Compare(Object[], Int32, Int32, Object[], Int32, Int32)

Compares two Object arrays lexicographically over the specified ranges.

Compare(Int32[], Int32[])

Compares two int arrays lexicographically.

Compare(Single[], Single[])

Compares two float arrays lexicographically.

Compare(Int64[], Int64[])

Compares two long arrays lexicographically.

Compare(Int16[], Int16[])

Compares two short arrays lexicographically.

Compare(Double[], Double[])

Compares two double arrays lexicographically.

Compare(Char[], Char[])

Compares two char arrays lexicographically.

Compare(Byte[], Byte[])

Compares two byte arrays lexicographically.

Compare(Boolean[], Boolean[])

Compares two boolean arrays lexicographically.

Compare(Object[], Object[])

Compares two Object arrays, within comparable elements, lexicographically.

Compare(Object[], Object[], IComparator)

Compares two Object arrays lexicographically using a specified comparator.

Compare(Byte[], Int32, Int32, Byte[], Int32, Int32)

Compares two byte arrays lexicographically over the specified ranges.

[Android.Runtime.Register("compare", "([BII[BII)I", "", ApiSince=33)]
public static int Compare (byte[] a, int aFromIndex, int aToIndex, byte[] b, int bFromIndex, int bToIndex);
[<Android.Runtime.Register("compare", "([BII[BII)I", "", ApiSince=33)>]
static member Compare : byte[] * int * int * byte[] * int * int -> int

Parameters

a
Byte[]

the first array to compare

aFromIndex
Int32

the index (inclusive) of the first element in the first array to be compared

aToIndex
Int32

the index (exclusive) of the last element in the first array to be compared

b
Byte[]

the second array to compare

bFromIndex
Int32

the index (inclusive) of the first element in the second array to be compared

bToIndex
Int32

the index (exclusive) of the last element in the second array to be compared

Returns

Int32

the value 0 if, over the specified ranges, the first and second array are equal and contain the same elements in the same order; a value less than 0 if, over the specified ranges, the first array is lexicographically less than the second array; and a value greater than 0 if, over the specified ranges, the first array is lexicographically greater than the second array

Attributes

Remarks

Java documentation for java.util.Arrays.compare(byte[], int, int, byte[], int, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Compare(Char[], Int32, Int32, Char[], Int32, Int32)

Compares two char arrays lexicographically over the specified ranges.

[Android.Runtime.Register("compare", "([CII[CII)I", "", ApiSince=33)]
public static int Compare (char[] a, int aFromIndex, int aToIndex, char[] b, int bFromIndex, int bToIndex);
[<Android.Runtime.Register("compare", "([CII[CII)I", "", ApiSince=33)>]
static member Compare : char[] * int * int * char[] * int * int -> int

Parameters

a
Char[]

the first array to compare

aFromIndex
Int32

the index (inclusive) of the first element in the first array to be compared

aToIndex
Int32

the index (exclusive) of the last element in the first array to be compared

b
Char[]

the second array to compare

bFromIndex
Int32

the index (inclusive) of the first element in the second array to be compared

bToIndex
Int32

the index (exclusive) of the last element in the second array to be compared

Returns

Int32

the value 0 if, over the specified ranges, the first and second array are equal and contain the same elements in the same order; a value less than 0 if, over the specified ranges, the first array is lexicographically less than the second array; and a value greater than 0 if, over the specified ranges, the first array is lexicographically greater than the second array

Attributes

Remarks

Java documentation for java.util.Arrays.compare(char[], int, int, char[], int, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Compare(Double[], Int32, Int32, Double[], Int32, Int32)

Compares two double arrays lexicographically over the specified ranges.

[Android.Runtime.Register("compare", "([DII[DII)I", "", ApiSince=33)]
public static int Compare (double[] a, int aFromIndex, int aToIndex, double[] b, int bFromIndex, int bToIndex);
[<Android.Runtime.Register("compare", "([DII[DII)I", "", ApiSince=33)>]
static member Compare : double[] * int * int * double[] * int * int -> int

Parameters

a
Double[]

the first array to compare

aFromIndex
Int32

the index (inclusive) of the first element in the first array to be compared

aToIndex
Int32

the index (exclusive) of the last element in the first array to be compared

b
Double[]

the second array to compare

bFromIndex
Int32

the index (inclusive) of the first element in the second array to be compared

bToIndex
Int32

the index (exclusive) of the last element in the second array to be compared

Returns

Int32

the value 0 if, over the specified ranges, the first and second array are equal and contain the same elements in the same order; a value less than 0 if, over the specified ranges, the first array is lexicographically less than the second array; and a value greater than 0 if, over the specified ranges, the first array is lexicographically greater than the second array

Attributes

Remarks

Java documentation for java.util.Arrays.compare(double[], int, int, double[], int, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Compare(Int16[], Int32, Int32, Int16[], Int32, Int32)

Compares two short arrays lexicographically over the specified ranges.

[Android.Runtime.Register("compare", "([SII[SII)I", "", ApiSince=33)]
public static int Compare (short[] a, int aFromIndex, int aToIndex, short[] b, int bFromIndex, int bToIndex);
[<Android.Runtime.Register("compare", "([SII[SII)I", "", ApiSince=33)>]
static member Compare : int16[] * int * int * int16[] * int * int -> int

Parameters

a
Int16[]

the first array to compare

aFromIndex
Int32

the index (inclusive) of the first element in the first array to be compared

aToIndex
Int32

the index (exclusive) of the last element in the first array to be compared

b
Int16[]

the second array to compare

bFromIndex
Int32

the index (inclusive) of the first element in the second array to be compared

bToIndex
Int32

the index (exclusive) of the last element in the second array to be compared

Returns

Int32

the value 0 if, over the specified ranges, the first and second array are equal and contain the same elements in the same order; a value less than 0 if, over the specified ranges, the first array is lexicographically less than the second array; and a value greater than 0 if, over the specified ranges, the first array is lexicographically greater than the second array

Attributes

Remarks

Java documentation for java.util.Arrays.compare(short[], int, int, short[], int, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Compare(Object[], Int32, Int32, Object[], Int32, Int32, IComparator)

Compares two Object arrays lexicographically over the specified ranges.

[Android.Runtime.Register("compare", "([Ljava/lang/Object;II[Ljava/lang/Object;IILjava/util/Comparator;)I", "", ApiSince=33)]
[Java.Interop.JavaTypeParameters(new System.String[] { "T" })]
public static int Compare (Java.Lang.Object[] a, int aFromIndex, int aToIndex, Java.Lang.Object[] b, int bFromIndex, int bToIndex, Java.Util.IComparator cmp);
[<Android.Runtime.Register("compare", "([Ljava/lang/Object;II[Ljava/lang/Object;IILjava/util/Comparator;)I", "", ApiSince=33)>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T" })>]
static member Compare : Java.Lang.Object[] * int * int * Java.Lang.Object[] * int * int * Java.Util.IComparator -> int

Parameters

a
Object[]

the first array to compare

aFromIndex
Int32

the index (inclusive) of the first element in the first array to be compared

aToIndex
Int32

the index (exclusive) of the last element in the first array to be compared

b
Object[]

the second array to compare

bFromIndex
Int32

the index (inclusive) of the first element in the second array to be compared

bToIndex
Int32

the index (exclusive) of the last element in the second array to be compared

cmp
IComparator

the comparator to compare array elements

Returns

Int32

the value 0 if, over the specified ranges, the first and second array are equal and contain the same elements in the same order; a value less than 0 if, over the specified ranges, the first array is lexicographically less than the second array; and a value greater than 0 if, over the specified ranges, the first array is lexicographically greater than the second array

Attributes

Remarks

Java documentation for java.util.Arrays.compare(T[], int, int, T[], int, int, java.util.Comparator<? super T>).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Compare(Int64[], Int32, Int32, Int64[], Int32, Int32)

Compares two long arrays lexicographically over the specified ranges.

[Android.Runtime.Register("compare", "([JII[JII)I", "", ApiSince=33)]
public static int Compare (long[] a, int aFromIndex, int aToIndex, long[] b, int bFromIndex, int bToIndex);
[<Android.Runtime.Register("compare", "([JII[JII)I", "", ApiSince=33)>]
static member Compare : int64[] * int * int * int64[] * int * int -> int

Parameters

a
Int64[]

the first array to compare

aFromIndex
Int32

the index (inclusive) of the first element in the first array to be compared

aToIndex
Int32

the index (exclusive) of the last element in the first array to be compared

b
Int64[]

the second array to compare

bFromIndex
Int32

the index (inclusive) of the first element in the second array to be compared

bToIndex
Int32

the index (exclusive) of the last element in the second array to be compared

Returns

Int32

the value 0 if, over the specified ranges, the first and second array are equal and contain the same elements in the same order; a value less than 0 if, over the specified ranges, the first array is lexicographically less than the second array; and a value greater than 0 if, over the specified ranges, the first array is lexicographically greater than the second array

Attributes

Remarks

Java documentation for java.util.Arrays.compare(long[], int, int, long[], int, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Compare(Single[], Int32, Int32, Single[], Int32, Int32)

Compares two float arrays lexicographically over the specified ranges.

[Android.Runtime.Register("compare", "([FII[FII)I", "", ApiSince=33)]
public static int Compare (float[] a, int aFromIndex, int aToIndex, float[] b, int bFromIndex, int bToIndex);
[<Android.Runtime.Register("compare", "([FII[FII)I", "", ApiSince=33)>]
static member Compare : single[] * int * int * single[] * int * int -> int

Parameters

a
Single[]

the first array to compare

aFromIndex
Int32

the index (inclusive) of the first element in the first array to be compared

aToIndex
Int32

the index (exclusive) of the last element in the first array to be compared

b
Single[]

the second array to compare

bFromIndex
Int32

the index (inclusive) of the first element in the second array to be compared

bToIndex
Int32

the index (exclusive) of the last element in the second array to be compared

Returns

Int32

the value 0 if, over the specified ranges, the first and second array are equal and contain the same elements in the same order; a value less than 0 if, over the specified ranges, the first array is lexicographically less than the second array; and a value greater than 0 if, over the specified ranges, the first array is lexicographically greater than the second array

Attributes

Remarks

Java documentation for java.util.Arrays.compare(float[], int, int, float[], int, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Compare(Boolean[], Int32, Int32, Boolean[], Int32, Int32)

Compares two boolean arrays lexicographically over the specified ranges.

[Android.Runtime.Register("compare", "([ZII[ZII)I", "", ApiSince=33)]
public static int Compare (bool[] a, int aFromIndex, int aToIndex, bool[] b, int bFromIndex, int bToIndex);
[<Android.Runtime.Register("compare", "([ZII[ZII)I", "", ApiSince=33)>]
static member Compare : bool[] * int * int * bool[] * int * int -> int

Parameters

a
Boolean[]

the first array to compare

aFromIndex
Int32

the index (inclusive) of the first element in the first array to be compared

aToIndex
Int32

the index (exclusive) of the last element in the first array to be compared

b
Boolean[]

the second array to compare

bFromIndex
Int32

the index (inclusive) of the first element in the second array to be compared

bToIndex
Int32

the index (exclusive) of the last element in the second array to be compared

Returns

Int32

the value 0 if, over the specified ranges, the first and second array are equal and contain the same elements in the same order; a value less than 0 if, over the specified ranges, the first array is lexicographically less than the second array; and a value greater than 0 if, over the specified ranges, the first array is lexicographically greater than the second array

Attributes

Remarks

Java documentation for java.util.Arrays.compare(boolean[], int, int, boolean[], int, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Compare(Int32[], Int32, Int32, Int32[], Int32, Int32)

Compares two int arrays lexicographically over the specified ranges.

[Android.Runtime.Register("compare", "([III[III)I", "", ApiSince=33)]
public static int Compare (int[] a, int aFromIndex, int aToIndex, int[] b, int bFromIndex, int bToIndex);
[<Android.Runtime.Register("compare", "([III[III)I", "", ApiSince=33)>]
static member Compare : int[] * int * int * int[] * int * int -> int

Parameters

a
Int32[]

the first array to compare

aFromIndex
Int32

the index (inclusive) of the first element in the first array to be compared

aToIndex
Int32

the index (exclusive) of the last element in the first array to be compared

b
Int32[]

the second array to compare

bFromIndex
Int32

the index (inclusive) of the first element in the second array to be compared

bToIndex
Int32

the index (exclusive) of the last element in the second array to be compared

Returns

Int32

the value 0 if, over the specified ranges, the first and second array are equal and contain the same elements in the same order; a value less than 0 if, over the specified ranges, the first array is lexicographically less than the second array; and a value greater than 0 if, over the specified ranges, the first array is lexicographically greater than the second array

Attributes

Remarks

Java documentation for java.util.Arrays.compare(int[], int, int, int[], int, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Compare(Object[], Int32, Int32, Object[], Int32, Int32)

Compares two Object arrays lexicographically over the specified ranges.

[Android.Runtime.Register("compare", "([Ljava/lang/Comparable;II[Ljava/lang/Comparable;II)I", "", ApiSince=33)]
[Java.Interop.JavaTypeParameters(new System.String[] { "T extends java.lang.Comparable<? super T>" })]
public static int Compare (Java.Lang.Object[] a, int aFromIndex, int aToIndex, Java.Lang.Object[] b, int bFromIndex, int bToIndex);
[<Android.Runtime.Register("compare", "([Ljava/lang/Comparable;II[Ljava/lang/Comparable;II)I", "", ApiSince=33)>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T extends java.lang.Comparable<? super T>" })>]
static member Compare : Java.Lang.Object[] * int * int * Java.Lang.Object[] * int * int -> int

Parameters

a
Object[]

the first array to compare

aFromIndex
Int32

the index (inclusive) of the first element in the first array to be compared

aToIndex
Int32

the index (exclusive) of the last element in the first array to be compared

b
Object[]

the second array to compare

bFromIndex
Int32

the index (inclusive) of the first element in the second array to be compared

bToIndex
Int32

the index (exclusive) of the last element in the second array to be compared

Returns

Int32

the value 0 if, over the specified ranges, the first and second array are equal and contain the same elements in the same order; a value less than 0 if, over the specified ranges, the first array is lexicographically less than the second array; and a value greater than 0 if, over the specified ranges, the first array is lexicographically greater than the second array

Attributes

Remarks

Java documentation for java.util.Arrays.compare(T[], int, int, T[], int, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Compare(Int32[], Int32[])

Compares two int arrays lexicographically.

[Android.Runtime.Register("compare", "([I[I)I", "", ApiSince=33)]
public static int Compare (int[]? a, int[]? b);
[<Android.Runtime.Register("compare", "([I[I)I", "", ApiSince=33)>]
static member Compare : int[] * int[] -> int

Parameters

a
Int32[]

the first array to compare

b
Int32[]

the second array to compare

Returns

Int32

the value 0 if the first and second array are equal and contain the same elements in the same order; a value less than 0 if the first array is lexicographically less than the second array; and a value greater than 0 if the first array is lexicographically greater than the second array

Attributes

Remarks

Java documentation for java.util.Arrays.compare(int[], int[]).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Compare(Single[], Single[])

Compares two float arrays lexicographically.

[Android.Runtime.Register("compare", "([F[F)I", "", ApiSince=33)]
public static int Compare (float[]? a, float[]? b);
[<Android.Runtime.Register("compare", "([F[F)I", "", ApiSince=33)>]
static member Compare : single[] * single[] -> int

Parameters

a
Single[]

the first array to compare

b
Single[]

the second array to compare

Returns

Int32

the value 0 if the first and second array are equal and contain the same elements in the same order; a value less than 0 if the first array is lexicographically less than the second array; and a value greater than 0 if the first array is lexicographically greater than the second array

Attributes

Remarks

Java documentation for java.util.Arrays.compare(float[], float[]).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Compare(Int64[], Int64[])

Compares two long arrays lexicographically.

[Android.Runtime.Register("compare", "([J[J)I", "", ApiSince=33)]
public static int Compare (long[]? a, long[]? b);
[<Android.Runtime.Register("compare", "([J[J)I", "", ApiSince=33)>]
static member Compare : int64[] * int64[] -> int

Parameters

a
Int64[]

the first array to compare

b
Int64[]

the second array to compare

Returns

Int32

the value 0 if the first and second array are equal and contain the same elements in the same order; a value less than 0 if the first array is lexicographically less than the second array; and a value greater than 0 if the first array is lexicographically greater than the second array

Attributes

Remarks

Java documentation for java.util.Arrays.compare(long[], long[]).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Compare(Int16[], Int16[])

Compares two short arrays lexicographically.

[Android.Runtime.Register("compare", "([S[S)I", "", ApiSince=33)]
public static int Compare (short[]? a, short[]? b);
[<Android.Runtime.Register("compare", "([S[S)I", "", ApiSince=33)>]
static member Compare : int16[] * int16[] -> int

Parameters

a
Int16[]

the first array to compare

b
Int16[]

the second array to compare

Returns

Int32

the value 0 if the first and second array are equal and contain the same elements in the same order; a value less than 0 if the first array is lexicographically less than the second array; and a value greater than 0 if the first array is lexicographically greater than the second array

Attributes

Remarks

Java documentation for java.util.Arrays.compare(short[], short[]).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Compare(Double[], Double[])

Compares two double arrays lexicographically.

[Android.Runtime.Register("compare", "([D[D)I", "", ApiSince=33)]
public static int Compare (double[]? a, double[]? b);
[<Android.Runtime.Register("compare", "([D[D)I", "", ApiSince=33)>]
static member Compare : double[] * double[] -> int

Parameters

a
Double[]

the first array to compare

b
Double[]

the second array to compare

Returns

Int32

the value 0 if the first and second array are equal and contain the same elements in the same order; a value less than 0 if the first array is lexicographically less than the second array; and a value greater than 0 if the first array is lexicographically greater than the second array

Attributes

Remarks

Java documentation for java.util.Arrays.compare(double[], double[]).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Compare(Char[], Char[])

Compares two char arrays lexicographically.

[Android.Runtime.Register("compare", "([C[C)I", "", ApiSince=33)]
public static int Compare (char[]? a, char[]? b);
[<Android.Runtime.Register("compare", "([C[C)I", "", ApiSince=33)>]
static member Compare : char[] * char[] -> int

Parameters

a
Char[]

the first array to compare

b
Char[]

the second array to compare

Returns

Int32

the value 0 if the first and second array are equal and contain the same elements in the same order; a value less than 0 if the first array is lexicographically less than the second array; and a value greater than 0 if the first array is lexicographically greater than the second array

Attributes

Remarks

Java documentation for java.util.Arrays.compare(char[], char[]).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Compare(Byte[], Byte[])

Compares two byte arrays lexicographically.

[Android.Runtime.Register("compare", "([B[B)I", "", ApiSince=33)]
public static int Compare (byte[]? a, byte[]? b);
[<Android.Runtime.Register("compare", "([B[B)I", "", ApiSince=33)>]
static member Compare : byte[] * byte[] -> int

Parameters

a
Byte[]

the first array to compare

b
Byte[]

the second array to compare

Returns

Int32

the value 0 if the first and second array are equal and contain the same elements in the same order; a value less than 0 if the first array is lexicographically less than the second array; and a value greater than 0 if the first array is lexicographically greater than the second array

Attributes

Remarks

Java documentation for java.util.Arrays.compare(byte[], byte[]).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Compare(Boolean[], Boolean[])

Compares two boolean arrays lexicographically.

[Android.Runtime.Register("compare", "([Z[Z)I", "", ApiSince=33)]
public static int Compare (bool[]? a, bool[]? b);
[<Android.Runtime.Register("compare", "([Z[Z)I", "", ApiSince=33)>]
static member Compare : bool[] * bool[] -> int

Parameters

a
Boolean[]

the first array to compare

b
Boolean[]

the second array to compare

Returns

Int32

the value 0 if the first and second array are equal and contain the same elements in the same order; a value less than 0 if the first array is lexicographically less than the second array; and a value greater than 0 if the first array is lexicographically greater than the second array

Attributes

Remarks

Java documentation for java.util.Arrays.compare(boolean[], boolean[]).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Compare(Object[], Object[])

Compares two Object arrays, within comparable elements, lexicographically.

[Android.Runtime.Register("compare", "([Ljava/lang/Comparable;[Ljava/lang/Comparable;)I", "", ApiSince=33)]
[Java.Interop.JavaTypeParameters(new System.String[] { "T extends java.lang.Comparable<? super T>" })]
public static int Compare (Java.Lang.Object[]? a, Java.Lang.Object[]? b);
[<Android.Runtime.Register("compare", "([Ljava/lang/Comparable;[Ljava/lang/Comparable;)I", "", ApiSince=33)>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T extends java.lang.Comparable<? super T>" })>]
static member Compare : Java.Lang.Object[] * Java.Lang.Object[] -> int

Parameters

a
Object[]

the first array to compare

b
Object[]

the second array to compare

Returns

Int32

the value 0 if the first and second array are equal and contain the same elements in the same order; a value less than 0 if the first array is lexicographically less than the second array; and a value greater than 0 if the first array is lexicographically greater than the second array

Attributes

Remarks

Java documentation for java.util.Arrays.compare(T[], T[]).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Compare(Object[], Object[], IComparator)

Compares two Object arrays lexicographically using a specified comparator.

[Android.Runtime.Register("compare", "([Ljava/lang/Object;[Ljava/lang/Object;Ljava/util/Comparator;)I", "", ApiSince=33)]
[Java.Interop.JavaTypeParameters(new System.String[] { "T" })]
public static int Compare (Java.Lang.Object[]? a, Java.Lang.Object[]? b, Java.Util.IComparator cmp);
[<Android.Runtime.Register("compare", "([Ljava/lang/Object;[Ljava/lang/Object;Ljava/util/Comparator;)I", "", ApiSince=33)>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T" })>]
static member Compare : Java.Lang.Object[] * Java.Lang.Object[] * Java.Util.IComparator -> int

Parameters

a
Object[]

the first array to compare

b
Object[]

the second array to compare

cmp
IComparator

the comparator to compare array elements

Returns

Int32

the value 0 if the first and second array are equal and contain the same elements in the same order; a value less than 0 if the first array is lexicographically less than the second array; and a value greater than 0 if the first array is lexicographically greater than the second array

Attributes

Remarks

Java documentation for java.util.Arrays.compare(T[], T[], java.util.Comparator<? super T>).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to