static function AddExtension($path, $extension, $replaceExisting = false)
    {
        $result = $path;
        if ($replaceExisting)
        {
            $result = self::RemoveExtension($path);
        }
        if (!$extension) {
            return $result;
        }
        return join('.', array($result, System\Str::TrimLeft($extension, '.')));
    }
static function AddExtension($path, $extension, $replaceExisting = false)
    {
        $result = $path;
        if ($replaceExisting)
        {
            $result = self::RemoveExtension($path);
        }
        if (!$extension) {
            return $result;
        }
        return join('.', array($result, System\Str::TrimLeft($extension, '.')));
    }
static function AddExtension ( $ path , $ extension , $ replaceExisting = false ) { $ result = $ path ; if ( $ replaceExisting ) { $ result = self :: RemoveExtension ( $ path ) ; } if ( ! $ extension ) { return $ result ; } return join ( '.' , array ( $ result , System \ Str :: TrimLeft ( $ extension , '.' ) ) ) ; }
Adds given extension, leading dot is optional.
@param string $path
@param string $extension
@param bool $replaceExisting If true and extension exists, it is replaced.
@return string
Adds given extension leading dot is optional .