| Description |
|
The GetFileName method extracts the file name from the given PathString as the return string. The file name includes the extension (plus . prefix), if present.
|
|
| Microsoft MSDN Links |
System.IO
System.IO.Path
|
|
|
| A simple example |
program Project1;
{$APPTYPE CONSOLE}
uses
System.IO;
var
PathString : String;
begin
PathString := 'C:\My Documents\DelphiBasics.txt';
Console.WriteLine('"{0}" has file name "{1}"',
PathString,
System.IO.Path.GetFileName(PathString));
Console.Readline;
end.
| | Show full unit code | "C:\My Documents\DelphiBasics.txt" has file name "DelphiBasics.txt"
|
| |
|
|
|