From RAD Studio API Documentation
Jump to: navigation, search


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


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


Type Visibility Source Unit Parent
function public
System.IOUtils TPath


Extracts and returns the name and extension parts of a file name specified in FileName.

GetFileName extracts the name and extension parts of the file name given in FileName. The resulting string consists of the characters of FileName, starting with the first character after the colon or backslash that separates the path information from the file name and extension. The resulting string is equal to FileName if FileName contains no drive and directory parts.

FileName The file name from which the name and extension parts should be extracted.

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

See Also

Code Examples