System.SysUtils.ExtractFileExt

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function ExtractFileExt(const FileName: string): string;

C++

extern DELPHI_PACKAGE System::UnicodeString __fastcall ExtractFileExt(const System::UnicodeString FileName)/* overload */;

Properties

Type Visibility Source Unit Parent
function public
System.SysUtils.pas
System.SysUtils.hpp
System.SysUtils System.SysUtils

Description

Returns the extension portions of a file name.

Use ExtractFileExt to obtain the extension of a file name. For example, the following code returns the extension of the file name specified by a variable named MyFileName:

MyFilesExtension := ExtractFileExt(MyFileName); // Delphi

MyFilesExtension = ExtractFileExt(MyFileName); // C++

The resulting string includes the period character that separates the name and extension parts. This string is empty if the given file name has no extension.

Note: This function works for multi-byte character systems (MBCS).

See Also