public static string GetFileNameWithoutExtension(this string path) { var fileName = Path.GetFileNameWithoutExtension(path); return string.IsNullOrWhiteSpace(fileName) ? string.Empty : fileName; }