0

My code is:

 System.Threading.Thread.Sleep(300);
 for (int index = 1; index < pagename.Length; index++) {
     System.Threading.Thread.Sleep(400);
     statsRequest = statsRequest.Replace(pagename[index - 1], pagename[index]);
     statsRequest = statsRequest.Replace(title[index - 1], title[index]);

Every time I run the program, it works properly until it reaches this point, then I get an "index out of range" exception.

Why do I get that, and how do I fix it?

Toby Speight
  • 27,591
  • 48
  • 66
  • 103

0 Answers0