private static int IndexOfSegmentName(string filename)
{
// If it is a .del file, there's an '_' after the first character
int idx = filename.IndexOf('_', 1);
if (idx == -1)
{
// If it's not, strip everything that's before the '.'
idx = filename.IndexOf('.');
}
return idx;
}