Click or drag to resize

EnumerableExtensionsTryGetFirstAndLastT Method

Returns true and the first and last value of the enumeration, or, if the enumeration is empty, returns false.

Namespace: Altaxo.Collections
Assembly: AltaxoCore (in AltaxoCore.dll) Version: 4.8.3179.0 (4.8.3179.0)
Syntax
C#
public static bool TryGetFirstAndLast<T>(
	this IEnumerable<T> org,
	out T first,
	out T last
)

Parameters

org  IEnumerableT
The enumeration.
first  T
if successful, the first value of the enumeration.
last  T
If successful, the last value of the enumeration.

Type Parameters

T

[Missing <typeparam name="T"/> documentation for "M:Altaxo.Collections.EnumerableExtensions.TryGetFirstAndLast``1(System.Collections.Generic.IEnumerable{``0},``0@,``0@)"]

Return Value

Boolean
True if successful; otherwise false.

Usage Note

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).
See Also