filename_change_ext

Returns the indicated file name, changing the extension to a new one.

Syntax:

filename_change_ext(fname, newext);


Argument Description
fname The file to use.
newext The new extension to use.


Returns: String.


Description

This function returns the indicated file name with the extension (including the dot) changed to the new extension. By using an empty string as the new extension you can remove the extension part all together.


Example:

ext = filename_change_ext(file_find_first(working_directory + "\*.*", 0), "");

The above code gets the name of the file (as a string) with the extension part removed.


Back: File System Functions
Next: file_exists
© Copyright YoYo Games Ltd. 2018 All Rights Reserved