withExtension

fnauto withExtension(R, C)(R path, C[] ext) if (isRandomAccessRange!R && hasSlicing!R && hasLength!R && isSomeChar!(ElementType!R) && !isSomeString!R && isSomeChar!C)

Replace existing extension on filespec with new one.

Parameters

pathstring or random access range representing a filespec
extthe new extension

Returns

Range with path's extension (if any) replaced with ext.

The element encoding type of the returned range will be the same as path's.

See Also

fnauto withExtension(C1, C2)(C1[] path, C2[] ext) if (isSomeChar!C1 && isSomeChar!C2)

Ditto