I am receiving a Null Reference exception error, and it has something to do with either the substring function or the LastIndex function. I am pretty confused why
String[] m_SessionNames;
String[] filenames; //Filenames already initialized in code
int Index = 0;
foreach (String name in filenames)
{
MessageBox.Show(filenames[index]) //Works, Displays a string that includes a '\'
m_SessionNames[Index] = filenames[Index].Substring((filenames[Index].LastIndexOf('\\') > 0) ? filenames[Index].LastIndexOf('\\') + 1 : 0);
Index++;
}