replaceFileExtension

fun replaceFileExtension(filePath: String, newExtension: String): String

Given filePath to a fully qualified file, replace just the extension.

This is taken as the last set of string after the last dot. This means a string like

myFile.txt.java

Will only get the .java part replaced and not .txt.java together.