defaultExtension

fnimmutable(C1)[] defaultExtension(C1, C2)(in C1[] path, in C2[] ext) if (isSomeChar!C1 && is(immutable C1 == immutable C2))

Parameters

pathA path name.
extThe default extension to use.

Returns

The path given by path, with the extension given by ext

appended if the path doesn't already have one.

Including the dot in the extension is optional.

This function always allocates a new string, except in the case when path is immutable and already has an extension.