المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : To string or not to string



C# Programming
04-01-2009, 12:22 AM
I'm trying to optimize a bit of coding and trying to decide if there's a better way to retrieve a list of paired values. Right now I'm just adding the values to a string and using split to pull them out after the list is made.

The question is, would it be faster to use a list, array or some other collection rather than a string for a randomly sized list of 0 to 24 elements. Each element is a pair of single digit numbers.

Normally I wouldn't worry about something so trivial, however this piece of code will end up looping a few million times.

The true man wants two things: danger and play. For that reason he wants woman, as the most dangerous plaything.