Navigation  without Java Scripts

filenameext/3

filenameext(Filename,MainPart,Ext)

Return or replace a file name's extension

Remarks

The returned strings are in upper case. Note that the dot is considered a part of the extension. If the MainPart is an input argument, its extension - if any - will be ignored (see example below).

Example

filenameext("prolog.exe",Name,Ext),

filenameext(NewName,"prolog.exe",".err").

Name=PROLOG, Ext=.EXE, NewName=PROLOG.ERR