Posted on: 4/23/2015 3:19:18 AM | Views : 586

I have a method that I call possibly 100 times each time.  I declare a string array for the month and days of week.  Is it more efficient to declare these string arrays before my foreach which call my method and pass it in as a parameter or can I just do it in the method each time?
Main Method:
private string FixStartDateForSchedule(DateTime startDateToFix, string errorPath) { try { string[] dayofweek = new string[7]; dayofweek[0] = "Sun"; dayofweek[1] = "Mon"; dayofweek[2] = "Tue"; dayofweek[3] = "Wed"; dayofweek[4] = "Thu"; dayofweek[5] = "Fri"; dayofweek[6] = "Sat"; string[] monthname = new string[13]; monthname[1] = "Jan"; ...

Go to the complete details ...