AlgorithmsNCopiesOfT Method |
Creates an IEnumerator that enumerates a given item n times.
Namespace: X3Platform.CollectionsAssembly: X3Platform.Support (in X3Platform.Support.dll) Version: 1.0.0.0 (2.0.0.0)
Syntaxpublic static IEnumerable<T> NCopiesOf<T>(
int n,
T item
)
public:
generic<typename T>
static IEnumerable<T>^ NCopiesOf(
int n,
T item
)
Parameters
- n
- Type: SystemInt32
The number of times to enumerate the item. - item
- Type: T
The item that should occur in the enumeration.
Type Parameters
- T
[Missing <typeparam name="T"/> documentation for "M:X3Platform.Collections.Algorithms.NCopiesOf``1(System.Int32,``0)"]
Return Value
Type:
IEnumerableTAn IEnumerable<T> that yields
n copies
of
item.
Exceptions
Examples
The following creates a list consisting of 1000 copies of the double 1.0.
List<double> list = new List<double>(Algorithms.NCopiesOf(1000, 1.0));
See Also