##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# std::experimental::filesystem::path::replace_extension

From cppreference.com
< cpp‎ | experimental‎ | fs‎ | path

path& replace_extension( const path& replacement = path() ); | (1) | (filesystem TS)

Replaces the extension with `replacement`.

Firstly, any existing extension is removed.

Then, a dot character is appended if `replacement` is not empty or does not begin with a dot character.

`replacement` is appended to the path.

### [edit] Parameters

replacement | - | the extension to replace with

### [edit] Return value

*this

### [edit] Exceptions

(none)

### [edit] See also

replace_filename | replaces the last path component with another path (public member function) [edit]

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=cpp/experimental/fs/path/replace_extension&oldid=68627"