Description |
The ChangeExtension method returns a new string that contains the PathString value with its extension changed to NewExtension.
If PathString does not contain an extension, the NewExtension is added to it.
|
|
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(PathString);
Console.WriteLine;
Console.WriteLine('Changing the extension to ".asm"');
Console.WriteLine;
PathString := System.IO.Path.ChangeExtension(PathString, '.asm');
Console.WriteLine(PathString);
Console.Readline;
end.
| Show full unit code | C:\DelphiBasics.txt
Changing the extension to ".asm"
C:\DelphiBasics.asm
|
|
|
|