[feature request] Array.IsNullOrEmpty

  • Thread starter Thread starter Wiktor Zychla [C# MVP]
  • Start date Start date
W

Wiktor Zychla [C# MVP]

starting from .NET 2.0 there is a nice IsNullOrEmpty static method on a
System.String class which saves the time so instead of

string theString;

if ( theString != null && theString.Length > 0 )

you write

if ( !string.IsNullOrEmpty( theString ) )

I belive that the same pattern could be adopted for arrays so that instead
of

T[] array;

if ( array != null && array.Length > 0 )

you could write

if ( !Array.IsNullOrEmpty( array ) )

Regards,
Wiktor Zychla
 
Back
Top