How to initialize a list of strings (List) with many string values

后端 未结 11 1406
猫巷女王i
猫巷女王i 2020-11-28 18:40

How is it possible to initialize (with a C# initializer) a list of strings? I have tried with the example below but it\'s not working.

List opt         


        
11条回答
  •  天涯浪人
    2020-11-28 19:04

    This is how you would do it.

    List  list1 = new List ();

    Do Not Forget to add

    using System.Collections.Generic;

提交回复
热议问题