Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

Filter list contents with predicate (anonymous method)

using System;
using System.Collections.Generic;

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

Predicate<int> isPositive = delegate(int val) { return val > 0; };
var filtered = data.FindAll(isPositive);

Console.WriteLine(string.Join(",", filtered));
Comment

PREVIOUS NEXT
Code Example
Csharp :: c# function<T 
Csharp :: binary search between two indexes 
Csharp :: convert relative path to physical path c# 
Csharp :: == vs equals c# 
Csharp :: dispose await task c# 
Csharp :: c# remove numericUpDown white space 
Csharp :: lambda not null c# 
Csharp :: Display all members of class using a for loop vb.net 
Csharp :: lambda distinct by property 
Csharp :: WPF combobox filter as you type 
Csharp :: c# timestamp 
Csharp :: int to binary string with 4 characters 
Csharp :: unity c# public all codes 
Csharp :: the range data annotation attribute (Double) 
Csharp :: get path revit link unloaded 
Csharp :: 409 conflict 
Csharp :: c# uint 
Csharp :: c sharp making our custom function 
Csharp :: c# find the smallest string in an array of strings 
Csharp :: c# default parameter 
Csharp :: c# enum variable set to nonthing 
Csharp :: c# return propertty from each object in object lpist 
Csharp :: unity 3d fire shoting 
Csharp :: pun 2 matchmaking custom room properties 
Csharp :: unfreeze position in unity 
Csharp :: random.choice c# 
Csharp :: c# async rethrow exception 
Csharp :: two question marks c# 
Csharp :: asp.net core reverse engineer database 
Csharp :: ExpandoObject Syntax that Compile 
ADD CONTENT
Topic
Content
Source link
Name
8+1 =