ExtensionMethod.NET Home of 876 C#, Visual Basic, F# and Javascript extension methods


Indicates whether the specified array is null or empty (has no items). Returns true if the array parameter is null or empty; otherwise, false.


public static bool IsNullOrEmpty(this Array array)
   return array == null || array.Length == 0;


var array = new string[]{};
var isEmpty= array.IsNullOrEmpty();

Author: jepozdemir

Submitted on: 21 nov. 2023

Language: csharp

Type: System.Array

Views: 1250