Можно так:
Код:
ChangeFileExt('Старый файл.txt','Твоё новое расширение')
А в хелпе про ChangeFileExt вот что написано:
Цитата:
Changes the extension of a file name.
Unit
SysUtils
Category
file name utilities
Delphi syntax:
function ChangeFileExt(const FileName, Extension: string): string;
C++ syntax:
extern PACKAGE AnsiString __fastcall ChangeFileExt(const AnsiString FileName, const AnsiString Extension);
Description
ChangeFileExt takes the file name passed in FileName and changes the extension of the file name to the extension passed in Extension. Extension specifies the new extension, including the initial dot character.
ChangeFileExt does not rename the actual file, it just creates a new file name string.
Note: This function works with multi-byte character sets (MBCS).
|
То что выделено красным - не очень радует.