Answers for "filter list of strings c#"

C#
0

how to filter a list in c#

using System;
using System.Collections.Generic;

var vals = new List<int> {-1, -3, 0, 1, 3, 2, 9, -4};

List<int> filtered = vals.FindAll(e => e > 0);

Console.WriteLine(string.Join(',', filtered));
Posted by: Guest on August-25-2021

C# Answers by Framework

Browse Popular Code Answers by Language