c# - Is there a reason / benefit to converting a generic list to array? -


I have a function that gives a list of strings.

I can loop through that list as if it was an array.

Should I convert it to an array before doing this?

Edit: Because I am asking because I view the code online (and on it) / create a collection of strings using list (or other types), but then Call Back ToArray, why?

Unless you have specific access cases where it is necessary, along with NAT, There are more options for listings / inventory along with arrays outside the box.

If you are ever working on a memory-sensitive application, the array may have some minor footprint in the array, but I will not worry about the memory as long as one of your apps Not very sensitive issue.


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -