简体   繁体   中英

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.

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

使用Path::with_extension("")方法为您提供完整路径,并删除了可能的文件扩展名。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM