public static string GetExtension (string path)
{
if (path == null)
return null;
if (path.IndexOfAny (InvalidPathChars) != -1)
throw new ArgumentException ("Illegal characters in path.");
int iExt = findExtension (path);
if (iExt > -1)
{
if (iExt < path.Length - 1)
return path.Substring (iExt);
}
return string.Empty;
}