you should change
Ingredients
in
return $"{Name,-20} {Ingredients ,30} {FoodCategory.ToString(),30}
{CurrentNumOfIngredients,50} ";
to
string.Join(",", Ingredients)
and it will work as you want.
Added remark: I think Richards solution below is the better one, so this might be a point to start:
private string GetIngredients()
{
var sb = new System.Text.StringBuilder();
for (int i = 0; i < Ingredients.Length; i++ )
{
if (!string.IsNullOrEmpty(Ingredients[i]))
{
sb.Append($"{Ingredients[i]}|");
}
}
return sb.ToString();
}