CollectionExtensionsMiddleT Method
Gets the middle item(s) from an enumeration, i.e., one return item for odd lengths, two for even lengths.
Namespace: Gemstone.Collections.CollectionExtensionsAssembly: Gemstone.Common (in Gemstone.Common.dll) Version: 1.0.136 -- Release Build+d454dafd53fcce88fce9c0a8ec8597176c30b791
public static IEnumerable<T>? Middle<T>(
this IEnumerable<T> source
)
<ExtensionAttribute>
Public Shared Function Middle(Of T) (
source As IEnumerable(Of T)
) As IEnumerable(Of T)
public:
[ExtensionAttribute]
generic<typename T>
static IEnumerable<T>^ Middle(
IEnumerable<T>^ source
)
JavaScript does not support generic types or methods.
- source IEnumerableT
- An enumeration over which to find the middle element(s).
- T
- Type of elements in the source
IEnumerableTThe middle item(s) from an enumeration, or
null if
source is
null.In Visual Basic and C#, you can call this method as an instance method on any object of type
IEnumerableT. 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).
If enumeration length is even, two items will be returned representing the items in the middle of the set;
otherwise, if the enumeration length is odd, one item will be returned from exactly the middle of the set.