Convert a list from one type to another using Predicate and ConvertAll
List<Variabel> lv = new List<Variabel>();
lv.AddRange(liste);
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
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment