I am getting the error "Index was outside the bounds of the array."
This is what I want to have :
- check if the log line contain "ERROR" then check if the bottom line contain " at "
- if true check if the bottom line contain " at "
- While the state is true increment the string variable called checkDescr with the line
- do this again and again until the state is false.
Here is my code :
foreach (string log in logs)
{
if (log.Contains("ERROR"))
{
nextLine = index + 1;
descriptionLine = index + 2;
string checkDescr = "";
int descNb = descriptionLine + 1;
checkDescr = logs[descNb];
if (checkDescr.Contains(" at "))
{
while (logs[descNb].Contains(" at "))
{
descNb++;
checkDescr = checkDescr + logs[descNb];
}
}
}
}