PeterO.ArrayUtil

## PeterO.ArrayUtil

public static class ArrayUtil

Not documented yet.

Member Summary

### ArrayHashCode

public static int ArrayHashCode(
    System.Collections.Generic.IEnumerable array);

Not documented yet.

Parameters:

Return Value:

A 32-bit signed integer.

### ArrayHashCode

public static int ArrayHashCode<T>(
    System.Collections.Generic.IEnumerable<T> array);

Not documented yet.

Parameters:

Return Value:

A 32-bit signed integer.

### ArraysEqual

public static bool ArraysEqual<T>(
    System.Collections.Generic.IEnumerable<T> array1,
    System.Collections.Generic.IEnumerable<T> array2);

Determines whether two enumerable objects are equal.

Parameters:

Return Value:

true if both enumerable objects are null or both enumerable objects have the same elements and number of elements in the same order; otherwise, false .

### ArraysEqual

public static bool ArraysEqual<T>(
    System.Collections.Generic.IEnumerable<T> array1,
    System.Collections.Generic.IEnumerable<T> array2,
    System.Collections.Generic.IEqualityComparer<T> comparer);

Determines whether two enumerable objects are equal.

Parameters:

Return Value:

true if two enumerable objects are equal; otherwise, false .

Exceptions:

### ArrayToString

public static string ArrayToString<T>(
    System.Collections.Generic.IEnumerable<T> array);

Not documented yet.

Parameters:

Return Value:

A text string.

### ArrayToStringHex

public static string ArrayToStringHex(
    System.Collections.Generic.IEnumerable array);

Not documented yet.

Parameters:

Return Value:

A text string.

### CompareArrays

public static int CompareArrays<T>(
    System.Collections.Generic.IEnumerable<T> array1,
    System.Collections.Generic.IEnumerable<T> array2)
    where T : System.IComparable<T>T;

Not documented yet.

Parameters:

Return Value:

A 32-bit signed integer.

### CompareArrays

public static int CompareArrays<T>(
    System.Collections.Generic.IEnumerable<T> array1,
    System.Collections.Generic.IEnumerable<T> array2,
    System.Collections.Generic.IComparer<T> comparer)
    where T : System.IComparable<T>T;

Not documented yet.

Parameters:

Return Value:

A 32-bit signed integer.

Exceptions:

### CompareLists

public static int CompareLists<T>(
    System.Collections.Generic.IList<T> list1,
    System.Collections.Generic.IList<T> list2)
    where T : System.IComparable<T>T;

Compares two lists with the same type of items.

Parameters:

Return Value:

A 32-bit signed integer.

### CompareLists

public static int CompareLists<T>(
    System.Collections.Generic.IList<T> list1,
    System.Collections.Generic.IList<T> list2,
    System.Collections.Generic.IComparer<T> comparer)
    where T : System.IComparable<T>T;

Compares two lists with the same type of items.

Parameters:

Return Value:

A 32-bit signed integer.

Exceptions:

### FindItem

public static T FindItem<T>(
    System.Collections.Generic.IEnumerable<T> items,
    System.Predicate<T> func,
    T defaultValue);

Not documented yet.

Parameters:

Return Value:

A T object.

Exceptions:

### FindItem

public static T FindItem<T>(
    System.Collections.Generic.IEnumerable<T> items,
    T itemToFind,
    T defaultValue);

Finds an item or returns a default value if an item is not found.

Parameters:

Return Value:

A T object.

Exceptions:

### Reverse

public static void Reverse<T>(
    System.Collections.Generic.IList<T> list);

Reverses the order of the elements in the given list.

Parameters:

Exceptions:

### Reverse

public static void Reverse<T>(
    System.Collections.Generic.IList<T> list,
    int index,
    int count);

Reverses the order of the elements in the given list at the specified index and length.

Parameters:

Exceptions:

### Shuffle

public static void Shuffle<T>(
    System.Collections.Generic.IList<T> list,
    System.Random random);

Randomizes the order of a list’s items.

Parameters:

Exceptions:

### ToArray

public static PeterO.T<>[] ToArray<T>(
    System.Collections.Generic.IEnumerable<T> collection);

Converts an enumerable to an array.

Parameters:

Return Value:

A T[] object.

Exceptions:

Back to petero-csharp start page.