Initializing a C# array with multiple copies of the same element

后端 未结 5 1858

In the C++ Standard Template Library (STL), it is possible for example to create a vector consisting of multiple copies of the same element, using this constructor:

5条回答
  •  误落风尘
    2021-01-07 18:05

    the for each (or better the classic for) is always much faster than using Linq. You should use the Linq expression only if it makes the code more readable

提交回复
热议问题