T
Tony Johansson
Hello!
When I use string.format in this way will that hurt the performance. I mean
you should not concatenate a lot of string together you should instead use
the StringBuilder. So I wonder how will the runtime do in this case.?
foreach (Animal animal in animalManager.Animals.ToArray())
{
lstOutput.Items.Add(string.Format("{0,-20}{1,-20}{2,-20}{3,-20}
{4,-20} {5,-20} {6,-20} {7,-20} {8,-20}", animal.ID, animal.Category,
animal.MyAnimal, animal.Name,
animal.Age.ToString(), animal.Gender, animal.Aggressive,
animal.Housing, foodList));//,"No Extra Info"));
}
//Tony
When I use string.format in this way will that hurt the performance. I mean
you should not concatenate a lot of string together you should instead use
the StringBuilder. So I wonder how will the runtime do in this case.?
foreach (Animal animal in animalManager.Animals.ToArray())
{
lstOutput.Items.Add(string.Format("{0,-20}{1,-20}{2,-20}{3,-20}
{4,-20} {5,-20} {6,-20} {7,-20} {8,-20}", animal.ID, animal.Category,
animal.MyAnimal, animal.Name,
animal.Age.ToString(), animal.Gender, animal.Aggressive,
animal.Housing, foodList));//,"No Extra Info"));
}
//Tony