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