1/19
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
Enumerable.Range(start, count)
A LINQ sequence-generation method that creates a sequence of consecutive integers beginning at a specified value and containing a specified number of elements. Domain: C# → .NET → System.Linq → Sequence Generation & Combination
IEnumerable
Generates the sequence 1, 2, 3, 4, 5.
var numbers = Enumerable.Range(10, 4);
Generates four consecutive integers beginning at 10: 10, 11, 12, 13.
Enumerable.Repeat(element, count)
A LINQ sequence-generation method that creates a sequence containing the same specified element repeated a specified number of times.
IEnumerable
Generates a sequence containing "Hello" three times.
var zeros = Enumerable.Repeat(0, 5);
Generates a sequence containing five zero values.
Enumerable.Empty
A LINQ sequence-generation method that returns an empty IEnumerable
IEnumerable
Creates an empty sequence whose element type is int.
IEnumerable
Creates an empty sequence whose element type is string.
Concat()
A LINQ sequence-combination operator that places the elements of one sequence after the elements of another sequence while preserving duplicates.
var results = first.Concat(second);
Returns a sequence containing all elements from first followed by all elements from second.
Concat() vs Union()
Concat() combines sequences while preserving duplicate elements, whereas Union() combines sequences using set semantics and removes duplicates according to equality.
Append()
A LINQ sequence-combination operator that returns a sequence with one specified element added after all elements of the source sequence.
var results = numbers.Append(100);
Returns the original sequence followed by the value 100.
Prepend()
A LINQ sequence-combination operator that returns a sequence with one specified element placed before all elements of the source sequence.
var results = numbers.Prepend(0);
Returns a sequence beginning with 0 followed by all elements from the original sequence.
var results = numbers.Prepend(0).Append(100);
Returns a sequence with 0 placed before the original elements and 100 placed after them.
Append() and Prepend() Behavior
Append() and Prepend() return new sequence views and do not directly modify the original source collection.
Sequence Generation
The creation of an IEnumerable
Sequence Combination
The construction of a resulting sequence by connecting existing sequences or adding elements before or after a sequence.