Replace Filename Extension (C++17)
Note this only works in C++ 17 (or boost::filesystem on lower):
#include <filesystem>
namespace fs = std::filesystem;
fs::path p(full_path);
p.replace_extension();
.replace_extension()
by default removes an extension, but you can pass what to replace it with, for instance .replace_extension(L".png")
.
Thanks! You can always email me or use contact form for more questions/comments etc.