Why can't I convert an object (which is really object[]) to string[]?
arrays, c#, casting, object
Solution
string[] newarr = Array.ConvertAll(objects, s => (string)s);
--EDIT--
since you've said I have an `object` (knowing that it is an `object[]` actually)
string[] newarr = Array.ConvertAll((object[])objects, s => (string)s);
Problem
I have a field that is of type 'object'. When I inspect it within the Watch window of visual studio I see its Object[] and when I drill into the elements I see each element is a string. But when I try to cast this to a String[] I get this error: Cannot cast 'MyObject' (which has an actual type of 'object[]') to 'string[]' string[] Any reason why I can't do this cast? What is the best way to convert this object to a string array?