IEnumerable<T>.Max Method

Overloads

Max

Returns the maximum value in the sequence.

Max(Func<T,Integer>)

Invokes a transform function on each element of the sequence and returns the maximum Integer value.

Max(Func<T,Int64>)

Invokes a transform function on each element of the sequence and returns the maximum Int64 value.

Max(Func<T,Single>)

Invokes a transform function on each element of the sequence and returns the maximum Single value.

Max(Func<T,Double>)

Invokes a transform function on each element of the sequence and returns the maximum Double value.

Max(Func<T,Currency>)

Invokes a transform function on each element of the sequence and returns the maximum Currency value.

Max(IComparer<T>)

Returns the maximum value in the sequence by using the specified comparer.

Max(TComparison<T>)

Returns the maximum value in the sequence by using the specified comparison.

Max

Returns the maximum value in the sequence.

Delphi
function Max: T

Returns

T

The maximum value in the sequence.

Exceptions

The sequence is empty.

Max(Func<T,Integer>)

Invokes a transform function on each element of the sequence and returns the maximum Integer value.

Delphi
function Max(const selector: Func<T, Integer>): Integer

Parameters

selector
Func<T, Integer>

A transform function to apply to each element.

Returns

Integer

The maximum value in the sequence.

Exceptions

selector is nil .

The sequence is empty.

Max(Func<T,Int64>)

Invokes a transform function on each element of the sequence and returns the maximum Int64 value.

Delphi
function Max(const selector: Func<T, Int64>): Int64

Parameters

selector
Func<T, Int64>

A transform function to apply to each element.

Returns

Int64

The maximum value in the sequence.

Exceptions

selector is nil .

The sequence is empty.

Max(Func<T,Single>)

Invokes a transform function on each element of the sequence and returns the maximum Single value.

Delphi
function Max(const selector: Func<T, Single>): Single

Parameters

selector
Func<T, Single>

A transform function to apply to each element.

Returns

Single

The maximum value in the sequence.

Exceptions

selector is nil .

The sequence is empty.

Max(Func<T,Double>)

Invokes a transform function on each element of the sequence and returns the maximum Double value.

Delphi
function Max(const selector: Func<T, Double>): Double

Parameters

selector
Func<T, Double>

A transform function to apply to each element.

Returns

Double

The maximum value in the sequence.

Exceptions

selector is nil .

The sequence is empty.

Max(Func<T,Currency>)

Invokes a transform function on each element of the sequence and returns the maximum Currency value.

Delphi
function Max(const selector: Func<T, Currency>): Currency

Parameters

selector
Func<T, Currency>

A transform function to apply to each element.

Returns

Currency

The maximum value in the sequence.

Exceptions

selector is nil .

The sequence is empty.

Max(IComparer<T>)

Returns the maximum value in the sequence by using the specified comparer.

Delphi
function Max(const comparer: IComparer<T>): T

Parameters

comparer
IComparer<T>

A comparer to compare values.

Returns

T

The maximum value in the sequence.

Exceptions

comparer is nil .

The sequence is empty.

Max(TComparison<T>)

Returns the maximum value in the sequence by using the specified comparison.

Delphi
function Max(const comparer: TComparison<T>): T

Parameters

comparer
TComparison<T>

A comparison to compare values.

Returns

T

The maximum value in the sequence.

Exceptions

comparer is nil .

The sequence is empty.