System.IOUtils.TPath.GetFileName

From XE2 API Documentation
Jump to: navigation, search

Delphi

class function GetFileName(const FileName: string): string; inline; static;

C++

static System::UnicodeString __fastcall GetFileName(const System::UnicodeString FileName);

Properties

Type Visibility Source Unit Parent
function public
System.IOUtils.pas
System.IOUtils.hpp
System.IOUtils TPath

Description

Extracts the name and extension parts of a file name.

GetFileName extracts the name and extension parts of the given file name. The resulting string consists of the leftmost characters of FileName, starting with the first character after the colon or backslash that separates the path information from the name and extension. The resulting string is equal to FileName if FileName contains no drive and directory parts. The following table lists the parameters expected by this method.

Name Meaning

FileName

The file name from which the name and extension are extracted.

Note: GetFileName raises an exception if the given file name contains invalid characters.

See Also

Code Examples