C# declare empty string array

前端 未结 9 625
囚心锁ツ
囚心锁ツ 2020-12-23 12:51

I need to declare an empty string array and i\'m using this code

string[] arr = new String[0]();

But I get \"method name expected\" error.<

9条回答
  •  无人及你
    2020-12-23 13:24

    Those curly things are sometimes hard to remember, that's why there's excellent documentation:

    // Declare a single-dimensional array  
    int[] array1 = new int[5];
    

提交回复
热议问题