Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

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));
Source by zetcode.com #
 
PREVIOUS NEXT
Tagged: #filter #list
ADD COMMENT
Topic
Name
3+6 =