LINQ Repeat MethodIn LINQ, the Repeat method or operator is used to generate the collection with the same number as the repeated times based on the specified index value. Syntax of LINQ Repeat MethodHere is the syntax of the LINQ Repeat method to generate the repeated number based on specified index values. In the above syntax, we defined the Repeat method with two parameters. Here the first parameter tells the starting elements of the integer, and the second parameter is the one tells how many times the same number repeated in sequence. Example of LINQ Repeat MethodHere is the example of the LINQ Repeat method to generate the collection, which contains the same number all the time. In the above code, we defined the Repeated method in the Range(100,10). So it will take the starting number as "100" and it will generate the same number "10" times. This is because the second parameter is defined as 10; that is why it will return the same number10 times. OUTPUT: Here we show how we can use the LINQ Repeat method to generate the collection with the repeated number based on the specified length in C#. Next TopicLINQ Empty Method |