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

后端 未结 11 1356
猫巷女王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:03

    List animals= new List();
    animals.Add("dog");
    animals.Add("tiger");
    

提交回复
热议问题