hii,
according to me you are trying to accessing values from array which not exists..
you need to check whether or not there are values or not in the array details then only you need to do the remeaning logic..
i have tried an example..and its working....
static List<String> accounts = new List<String>();
string line = string.Empty;
line = "hello World";
string[] details = line.Split(' ');
if(details[0] !=string.Empty && details[1] !=string.Empty)
{
accounts.Add(details[0].Substring(0, 5) + &:& + details[1].Substring(0, 5));
}
}
check that whether array contains values for details[0] and details[1] and also whether details[0] and details[1] exists or not as well...
thanks..