Convert a list from one type to another using Predicate and ConvertAll

No comments

List<Variabel> lv = new List<Variabel>();


List<string> lst = lv.ConvertAll<string>(delegate(Variabel g) { return g.Navn; });

Converts a list of objects with type Variabel,

to a list of strings.

Variabel contains a string property called Navn, and this is what gets translated to the list of strings,

{ return g.Navn)}

Posted via email from Henris blogg

No comments :

Post a Comment