List(IEnumerable), a very interesting usage of List, you can copy all the values and length during initialization:
// name可以是数组、也可以是list或者是其他实现IEnumerable接口的类型,但不能是null
var list = new List<string>(name);
Official website related links => link .
Official explanation:
**List<T>(IEnumerable<T>)**
Initializes a new instance of the List<T> class that contains elements copied from the specified collection and has sufficient capacity to accommodate the number of elements copied.
**Parameters**
collection IEnumerable<T>
The collection whose elements are copied to the new list.
**Exceptions**
ArgumentNullException
collection is null.