function ChangeFileExt(const Value: String; const NewExt: String): String
The ChangeFileExt function changes the file extension in the string input parameter to the new file extension. The string input parameter can contain both a path and a file name or just a file name, but the file name should include a file extension. The specified file extension should include the period (.) file extension delimiter. The return value is a String value containing the original path and/or file name with the new file extension.
Examples
X := ChangeFileExt('https://www.elevatesoft.com/index.html','.js'); // X is 'https://www.elevatesoft.com/index.js'