CountNonEmptyItemsInStringArray

int n= src.Count( p => String.IsNullOrEmpty( p ) == false );
Example:
int len = 10;
string[] src = new string[len];

src[5]="some text";

// count non-null or non-empty items within src-arry
int n= src.Count( p => String.IsNullOrEmpty( p ) == false );

// n should return 1;

Description

Method returns the number of non-null or non-empty items wihtin a string array of length n.

Details

Double click on the code to select all.

 

;