[lang-ref] ( example_exclude_empty_elements ) ( csharp )

[Fact]
public void TestExampleExcludeEmptyElements()
{
    // just use filter
    List<string> items = new() { "A", "", "B", "", "", "C", "", "", "" };
    List<string> expected = new() { "A", "B", "C" };

    List<string> actual = items.Where(x => x != "").ToList();

    Assert.Equal(expected, actual);
}