Let's say I have:
class Plus5 {
Plus5(int i) {
i+5;
}
}
List<int> initialList = [0,1,2,3]
How I can create, from initialList, another list calling Plus5() constructor for each element of initialList.
Is here something better than the following?
List<Plus5> newList = new List<Plus5>();
initialList.ForEach( i => newList.Add(Plus5(int)));
Plus5type? It sounds like you may just want to build a new list ofintwhere theintshappen to be incremented by 5