csharp initialize empty array

Code Example - csharp initialize empty array

                
                        datatype[] arr = new datatype[]{};
or
datatype[] arr = new datatype[0];
or
datatype[] array = {}
or
var a = Array.Empty<datatype>();
                    
                
 

clear array csharp

                        
                                using System;
Array.Clear(arr, 0, arr.Length);
                            
                        
 

csharp empty array

                        
                                object[] emptyArray = new object[0];
                            
                        
 

how to empty an array csharp

                        
                                Array.Clear(arr, 0, arr.Length);
                            
                        
 

csharp declare empty string array

                        
                                string[] stringArray = new string[] {};
                            
                        
 

csharp check if array is empty

                        
                                if(array == null || array.Length == 0)