use std::path::Path;
use std::ffi::OsStr;
fn main() {
let path = Path::new("F:/AUPMODEL/1156668/1156668.blend");
let parent = path.parent();
assert_eq!(parent,Some(Path::new("F:/AUPMODEL/1156668")));
let file_stem = path.file_stem();
assert_eq!(file_stem,Some(OsStr::new("1156668")));
let extension = path.extension();
assert_eq!(extension,Some(OsStr::new("blend")));
println!("完整文件名:{:?}\n文件夹路径:{:?}\n文件名-无后缀:{:?}\n后缀:{:?}",path,parent,file_stem,extension);
}
————————————————
原文链接:https://blog.csdn.net/weixin_41767230/article/details/117074827
如果文章或资源对您有帮助,欢迎打赏作者。一路走来,感谢有您!
txttool.com 说一段 esp56物联 查询128 IP查询