Class EnumerableExtensions
Provides extension methods for IEnumerable<T>.
Inherited Members
Namespace: MathLib
Assembly: MathLib.dll
Syntax
public static class EnumerableExtensions
Methods
| Edit this page View SourceStr<T>(IEnumerable<T>, string, int)
Joins the elements of the enumerable into a string, separated by the specified delimiter. Each element is left-padded to meet a specified total width.
Declaration
public static string Str<T>(this IEnumerable<T> source, string delimiter = "", int totalWidth = 0) where T : notnull
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<T> | source | The enumerable to join. |
| string | delimiter | The delimiter to insert between each element. Defaults to an empty string. |
| int | totalWidth | The total width of each element in the joined string. Defaults to 0 (no padding). |
Returns
| Type | Description |
|---|---|
| string | A string with the joined elements, padded to the specified total width. |
Type Parameters
| Name | Description |
|---|---|
| T | The type of the elements in the enumerable. Must not be null. |
Sum(IEnumerable<BigInteger>)
Sum of all elements in the specified source.
Declaration
public static BigInteger Sum(this IEnumerable<BigInteger> source)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<BigInteger> | source | Collection of BigInteger elements. |
Returns
| Type | Description |
|---|---|
| BigInteger | Total sum as BigInteger. |