Cant figure out why this isnt working? When I console.writeline the values inside the loop, newFruits contains the correct values. All I get is System.String[] as the output
public static string[] FuncSortItemsInList(string[] fruits)
{
Array.Sort(fruits);
Array.Reverse(fruits);
string[] newFruits = new string[fruits.Length];
for (int i = 0; i< fruits.Length; i++)
{
newFruits[i] = fruits[i];
}
return newFruits;
}
}
class Program
{
static void Main()
{
//Food.SortItemsInList(new string[] { "Banana", "Apple", "Pineapple" });
Console.WriteLine(Food.FuncSortItemsInList(new string[] { "Banana", "Apple", "Pineapple" }));
}
}
Console.WriteLineaccepts and prints a single string among other overloads, but not an array of strings in any case.