Table of Contents

Class Enumerators

Namespace
Utils.Objects
Assembly
Utils.dll

Provides helper methods that expand textual or numeric ranges into strongly typed sequences.

public static class Enumerators
Inheritance
Enumerators
Inherited Members

Methods

EnumerateCount<T>(T, T, int)

Enumerates a fixed number of values between the start and end bounds.

public static IEnumerable<T> EnumerateCount<T>(T start, T end, int numberOfValues) where T : INumber<T>

Parameters

start T

The first value in the sequence.

end T

The final value to include in the sequence.

numberOfValues int

The total number of elements that should be generated.

Returns

IEnumerable<T>

An evenly spaced sequence spanning from start to end.

Type Parameters

T

The numeric type produced by the enumeration.

Exceptions

ArgumentOutOfRangeException

Thrown when numberOfValues is less than one.

Enumerate<T>(string)

Parses a textual range description and yields each numeric value described by the range.

public static IEnumerable<T> Enumerate<T>(string ranges) where T : IBinaryInteger<T>

Parameters

ranges string

A string that may contain comma-separated values or dash-separated intervals.

Returns

IEnumerable<T>

An enumeration of all numeric values referenced by ranges.

Type Parameters

T

The numeric type produced by the enumeration.

Enumerate<T>(string, CultureInfo)

Parses a textual range description and yields each numeric value described by the range.

public static IEnumerable<T> Enumerate<T>(string ranges, CultureInfo cultureInfo) where T : IBinaryInteger<T>

Parameters

ranges string

A string that may contain comma-separated values or dash-separated intervals.

cultureInfo CultureInfo

Returns

IEnumerable<T>

An enumeration of all numeric values referenced by ranges.

Type Parameters

T

The numeric type produced by the enumeration.

Enumerate<T>(string, NumberFormatInfo, params string[])

Parses a textual range description and yields each numeric value described by the range.

public static IEnumerable<T> Enumerate<T>(string ranges, NumberFormatInfo numberFormatInfo, params string[] separators) where T : IBinaryInteger<T>

Parameters

ranges string

A string that may contain comma-separated values or dash-separated intervals.

numberFormatInfo NumberFormatInfo

Culture-specific formatting information used when parsing values.

separators string[]

Additional separators that delimit entries beyond the culture list separator.

Returns

IEnumerable<T>

An enumeration of all numeric values referenced by ranges.

Type Parameters

T

The numeric type produced by the enumeration.

Enumerate<T>(string, TextInfo)

Parses a textual range description and yields each numeric value described by the range.

public static IEnumerable<T> Enumerate<T>(string ranges, TextInfo textInfo) where T : IBinaryInteger<T>

Parameters

ranges string

A string that may contain comma-separated values or dash-separated intervals.

textInfo TextInfo

Returns

IEnumerable<T>

An enumeration of all numeric values referenced by ranges.

Type Parameters

T

The numeric type produced by the enumeration.

Enumerate<T>(string, params string[])

Parses a textual range description and yields each numeric value described by the range.

public static IEnumerable<T> Enumerate<T>(string ranges, params string[] separators) where T : IBinaryInteger<T>

Parameters

ranges string

A string that may contain comma-separated values or dash-separated intervals.

separators string[]

Additional separators that delimit entries beyond the culture list separator.

Returns

IEnumerable<T>

An enumeration of all numeric values referenced by ranges.

Type Parameters

T

The numeric type produced by the enumeration.

Enumerate<T>(T, T)

Enumerates every value between the given bounds using a default step of one unit.

public static IEnumerable<T> Enumerate<T>(T start, T end) where T : INumber<T>

Parameters

start T

The first value in the sequence.

end T

The final value to include in the sequence.

Returns

IEnumerable<T>

All values starting at start and ending at end.

Type Parameters

T

The numeric type produced by the enumeration.

Enumerate<T>(T, T, T)

Enumerates every value between the given bounds using the provided step magnitude.

public static IEnumerable<T> Enumerate<T>(T start, T end, T step) where T : INumber<T>

Parameters

start T

The first value in the sequence.

end T

The final value to include in the sequence.

step T

The difference between two consecutive values.

Returns

IEnumerable<T>

All values starting at start and ending at end using step increments.

Type Parameters

T

The numeric type produced by the enumeration.

Exceptions

ArgumentOutOfRangeException

Thrown when step is less than or equal to zero.