ArrayExtensionsCompareToT(T, T) Method

Returns comparison results of two binary arrays.

Definition

Namespace: Gemstone.ArrayExtensions
Assembly: Gemstone.Common (in Gemstone.Common.dll) Version: 1.0.110 -- Release Build+3e0464f4461df4d3e1175b13966eb47ff832554d
public static int CompareTo<T>(
	this T[]? source,
	T[]? other
)
where T : Object, IComparable<T>

Parameters

source  T
Source array.
other  T
Other array to compare to source array.

Type Parameters

T
Type of array.

Return Value

Int32

A signed integer that indicates the relative comparison of source array and other array.

Return ValueDescription
Less than zeroSource array is less than other array.
ZeroSource array is equal to other array.
Greater than zeroSource array is greater than other array.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type T. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Remarks

Note that if both arrays are null the arrays will be considered equal. If one array is null and the other array is not null, the non-null array will be considered larger. If the array lengths are not equal, the array with the larger length will be considered larger. If the array lengths are equal, the arrays will be compared based on content.

See Also