Click or drag to resize
AlgorithmsPartitionT Method
Partition a list or array based on a predicate. After partitioning, all items for which the predicate returned true precede all items for which the predicate returned false.

Namespace: X3Platform.Collections
Assembly: X3Platform.Support (in X3Platform.Support.dll) Version: 1.0.0.0 (2.0.0.0)
Syntax
public static int Partition<T>(
	IList<T> list,
	Predicate<T> predicate
)

Parameters

list
Type: System.Collections.GenericIListT
The list or array to partition.
predicate
Type: SystemPredicateT
A delegate that defines the partitioning condition.

Type Parameters

T

[Missing <typeparam name="T"/> documentation for "M:X3Platform.Collections.Algorithms.Partition``1(System.Collections.Generic.IList{``0},System.Predicate{``0})"]

Return Value

Type: Int32
The index of the first item in the second half of the partition; i.e., the first item for which predicate returned false. If the predicate was true for all items in the list, list.Count is returned.
Remarks
Although arrays cast to IList<T> are normally read-only, this method will work correctly and modify an array passed as list.
See Also