c# Array.ForEach alternative that replaces elements -
Is there a standard function that I can use again on an array in ForEach, in each element Applying a function and changing it with the result in the array? Something like the following, but later the dimension powers include the result of difference (2, I) on each element. Dimensions Powers = Numerical Category (0, dimension + 1) .oir (); Array.ForEach (Dimension Power, (i) => intoto (2, i)); (I know that I can iterate with an array for loop - I'm just wondering if there is a more concise option). Most types of orreter implementations (you actually need a "map" function) gives a new instance, for example an array, you can use LINQ: newArray = dimensionPowers.Select (i = & gt; IntPow (2, i)). ToArray (); Or better: dimension power = enumerable Category (0, dimension + 1). Choose (i => intoto (2, i)) .toArray (); However, if you want to modify the original array in-place, it is good to look old: for (int i = 0; I It is enough for...