Generate
Creates a collection by the given values.
WARNING
This method isn't available as an extension method.
Parameters
Returns
params T[ ] values
IEnumerable<T>
Usage
Creating a collection of integer numbers
IEnumerable<int> result = CollectionModule.Generate(1, 5, 3, 2);
//result = { 1, 5, 3, 2 }
Creating a string collection
IEnumerable<int> result =
CollectionModule.Generate("Hello", " ", "World", " and ", "Tango");
//result = { "Helo", " ", "World", " and ", "Tango" }
Last updated
Was this helpful?