IPath.ChangeExtension

Syntax

ChangeExtension(Path: String; Extension: String): String;

Parameters

Path - variable information of a path.

Extension - new extension. The empty string is assigned to delete existing extension from the Path parameter.

Description

The ChangeExtension method returns the string that contains changed information of a path. The method does not make any actions in the file system.

Example

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:

IPath