Convert string array 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[]
.)
Easiest approach:
MyArray = Array.ConvertAll(MyArray, d => d.ToLower());
Without creating a new Array.
for (int i = 0; i < MyArray.Length; i++)
MyArray[i] = MyArray[i].ToLower();
strin[] MyArrayLower = (from str in MyArray
select str.ToLower()).ToArray();