0
Iwant to delete null list items in c#
How can i delete list items that have null value in c#
1 Odpowiedź
0
Here is a simple console applicaion
using System;
using System.Collections.Generic;
namespace SoloLearn
{
internal static class BinaryToDecimal
{
private static void Main()
{
// Create dummy list
var nullList = new List<object> {null, 23, "SoloLearn", null};
//Remove null objects using Lambda predicate function
nullList.RemoveAll(item => item == null);
//Print list objects after filtering
foreach (var obj in nullList)
{
Console.WriteLine("Item:{0}", obj);
Console.ReadLine();
}
}
}
}