← all problems

renameExtension 🌶️🌶️

Write a method that takes two String parameters: filename, a file name with exactly one dot such as "notes.txt", and newExtension, a new extension without a dot such as "md". Return the file name with its extension replaced. For example, renameExtension("notes.txt", "md") should return "notes.md".