Answers for "filter a list of strings in 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

Code answers related to "filter a list of strings in c#"

C# Answers by Framework

Browse Popular Code Answers by Language