Hi there. I have here a short string, with each of those strings just being a single whole number. I have seen lots of different ways people have been converting those into int, but does anyone know which method is the most efficient?
I didn’t do a performance test before but this one i uses, since it is a bit shorter way, but this link can be use for performance benchmark, i added two alternatives, you can add the remaining and pick the best one:
string[] test = new string[] {"1", "2", "3", "4", "5"};
int[] arr = Array.ConvertAll<string, int>(test, int.Parse);
Test the performance of your program and do major optimization before you think about such micro optimizations.