Search code examples
rustfilepathfile-extension

How to get file path without extension in Rust?


Please help me to find an elegant way to get file path without extension; cut off file extension from path or something.


Solution

  • Check the Path::file_stem method. You can find an example there. It works at least from Rust 1.6.