Version: v0.8.1 - Beta.  We welcome contributors & feedback.

File.withFileExt

$file.withFileExt($newExtension) -> $newPath

Description

Create a new file path from the current file, with a new extension.

$origFile = file'files:/dir/data.txt'

$zipFile = $origFile.withFileExt('zip')
//= file'files:/dir/data.zip'
                         ^^^

See Also