Wednesday, June 5, 2019

C#: Convert List<long> to List<string> and Vice Versa

List listOfNumbers = new List() { 1, 2, 3 };
List listOfStrings = listOfNumbers.ConvertAll(n => n.ToString());
listOfNumbers = listOfStrings.ConvertAll(long.Parse);

No comments:

Post a Comment

Performance: Linking a List of Child Objects To a List of Parent Objects

Many a time I've had to build a relationship where a parent object has a list of child objects linked to it, where the parent itself als...