Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

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

 if ( (myList!= null) && (!myList.Any()) )
 {
     // Add new item
     myList.Add("new item"); 
 }
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #check #list #null #empty
ADD COMMENT
Topic
Name
6+2 =