I am stuck in something. I want to convert this object, which is a array of objects, into a array of strings I cannot find a good way to do that. Do I need to use a for loop? If someone can also tell me why these 2 methods failed, I will appreciate.
object greetings = new object[] { "hi", "hello", "greetings" };
if (greetings.GetType().IsArray)
{
//string[] arr = greetings as string[];
//string[] arr = (string[])greetings;
}
string[] arr = Array.ConvertAll((object[])greetings, Convert.ToString);