You want to use array indexing if you know where in the array the element is that you want to check. So like this in your case:
if (string.IsNullOrEmpty(del.counts[0]))
{
// Code
}
If you do not know where the element is you'll want to use Linq's Any(...) extension Mehtod.
if (del.counts.Any(value => string.IsNullOrEmpty(value))
{
// Code
}
Any(...) will return true if any element of the array is NullOrEmpty and false if not
So you would use it like so in your application:
if (del.counts == null && del.mrate == null)
{
// Your code to handle if 'del.counts' and 'del.mrate' are null
}
// We know 'del.counts' is not null, but one of the elements may be NullOrEmpty
else if (del.counts.Any(value => string.IsNullOrEmpty(value)))
{
// Your code to handle if one of the counts elements IsNullOrEmpty
}
You may want to remove the else if and replace it with an if statement depending on your context
string.IsNullOrEmpty(del.counts[0])? Note that it is notdel.countswhich has the value"". It is the first element inside it:del.counts[0]