ChangeExtension(Path: String; Extension: String): String;
Path - variable information of a path.
Extension - new extension. The empty string is assigned to delete existing extension from the Path parameter.
The ChangeExtension method returns the string that contains changed information of a path. The method does not make any actions in the file system.
Sub Main;
Var
Path_File, s: String;
Begin
Path_File:="c:\Work\1.txt";
s:=Path.ChangeExtension(Path_File, ".xls");
End Sub Main;
After executing the example, the "s" variable contains the path C:\Work\1.xls.
See also: