How to define an empty string array in C#

1 Answer

0 votes
using System;

namespace ConsoleApplication_C_Sharp
{
    class Program
    {
        static void Main(string[] args)
        {
            var arr = new string[] { };

            Console.WriteLine(arr.Length);
        }
    }
}


/*
run:
      
0

*/

 



answered Dec 28, 2016 by avibootz

Related questions

2 answers 238 views
5 answers 324 views
1 answer 80 views
1 answer 165 views
1 answer 170 views
2 answers 190 views
190 views asked Oct 28, 2019 by avibootz
...