In Ruby you can use the map/collect method on an array to modify it:
a = [ "a", "b", "c", "d" ]
a.collect! {|x| x + "!" }
a #=> [ "a!", "b!", "c!", "d!" ]
Is there a simple way to do this in C#?
a = a.Select( s => s + "!" ).ToArray();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With