c# - How convert ToList method to LINQ expression -
c# - How convert ToList method to LINQ expression -
list<string> tolist(string[] names) { list<string> l = new list<string>(); foreach (string n in names) { l.add(n.toupper()); l.add(n.tolower()); } homecoming l; }
how convert tolist method linq expression(method syntax). help much appreciated. thanks.
names.selectmany(x => new[] { x.tolower(), x.toupper() }).tolist()
c# linq
Comments
Post a Comment