Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

Filter list contents with predicate (Lambda)

using System;
using System.Collections.Generic;

var words = new List<string> { "falcon", "wood", "tree",
    "rock", "cloud", "rain" };

Predicate<string> hasFourChars = word => word.Length == 4;

var words2 = words.FindAll(hasFourChars);
Console.WriteLine(string.Join(',', words2));
Comment

PREVIOUS NEXT
Code Example
Csharp :: parsing object from text file c# 
Csharp :: chaine de connexion sql server c# 
Csharp :: print the top view of the binary tree 
Csharp :: string extentions not working 
Csharp :: what is the default value for an enum c# 
Csharp :: netmath hack console 
Csharp :: using mediamanager how to play mp3 files 
Csharp :: c# asqueryable select 
Csharp :: OOP inC# 
Csharp :: using == is inefficient unity 
Csharp :: satisfactory controller support 
Csharp :: php encrypt message encrypt() decrypt 
Csharp :: how to set an expiry date on a program 
Csharp :: vb.net ionic zip examples 
Csharp :: get path revit linked unload 
Csharp :: c# properties making string required 
Csharp :: unity organize variables in inspector 
Csharp :: asp.net render control to string 
Csharp :: binary search tree c# stackoverflow 
Csharp :: epmty char c# 
Csharp :: barcode print c# 
Csharp :: advance C# tricks and hits 
Csharp :: list in c# foreach 
Csharp :: Write N lines with M numbers each that describe the layout of the second layer in the way shown above 
Csharp :: bitter foods examplews 
Csharp :: null objects 
Csharp :: wpf open new Window in MVVM 
Csharp :: getString 
Csharp :: dotnet DB context register 
Csharp :: c# project 
ADD CONTENT
Topic
Content
Source link
Name
2+6 =