Categories
arrays c# string

Convert string array to lowercase

I have string array string[] MyArray. What is the quickest (meaning least code, not fastest performance) way to convert all string array elements to lowercase?

var MyArrayLower = MyArray.Select(s => s.ToLowerInvariant()).ToArray();

(or

MyArray = MyArray.Select(s => s.ToLowerInvariant()).ToArray();

if you want to replace the existing array with a new instance of string[].)