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 existent extension from the Path parameter.

Description

The ChangeExtension method returns a string that contains changed information of a path. The method does not perform any actions in 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 this example, variable "s" contains the path c:\Work\1.xls.

See also:

IPath