Answers for "using any to check if there is empty values in list c#"

C#
1

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
0

check if list contains any empty element in c#

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

Code answers related to "using any to check if there is empty values in list c#"

C# Answers by Framework

Browse Popular Code Answers by Language