Catel.IO.Path.GetFileName C# (CSharp) Метод

GetFileName() публичный статический Метод

Gets the name of the file.
The is null or whitespace.
public static GetFileName ( string path ) : string
path string The path to get the file name from.
Результат string
        public static string GetFileName(string path)
        {
            Argument.IsNotNullOrWhitespace("path", path);

            int lastSlashPosition = path.LastIndexOf(@"\");
            if (lastSlashPosition == -1)
            {
                return path;
            }

            return path.Remove(0, lastSlashPosition + 1);
        }