Answers for "c# check if list is empty"

C#
1

c# check if array is empty

if(array == null || array.Length == 0)
Posted by: Guest on May-21-2020
0

how to check a list is null or empty in c#

if ( (myList!= null) && (!myList.Any()) )
 {
     // Add new item
     myList.Add("new item"); 
 }
Posted by: Guest on March-29-2021
1

c# tell if list object is empty

if(listOfObjects.Count == 0){
//when list is empty
}
Posted by: Guest on August-05-2020
0

check if list contains any empty element in c#

if (myList.Any(i => i != null))
{
    DoSomeThing();
}
Posted by: Guest on December-22-2020

C# Answers by Framework

Browse Popular Code Answers by Language