chext (<file>,<string>)
string
Changes the extension on a file name and returns the changed name.
<file>The file name being changed.
<string>The new extension (including the '.' where necessary).
string newname = chext(myfile,'.dat')