There isn't anything built-in. You could use LINQ to create a new array easily:
arr = arr.Select(x => x + " Test").ToArray();
... but that's not going to modify the original array. If anything else has a reference to the original array, they won't see the change. Usually that's actually a good thing IMO, but occasionally you might want to modify the existing collection.
For that, you could write your own general purpose method to modify an existing array (or any other IList<T>
implementation):
public static void ModifyAll<T>(this IList<T> source, Func<T, T> modification)
{
// TODO: Argument validation
for (int i = 0; i < source.Count; i++)
{
source[i] = modification(source[i]);
}
}
Then you could use:
arr.ModifyAll(x => x + " Test");
I would definitely use this rather than writing a string-concatenation-specific extension method.