C++11

std::string base_name = full_path.substr(full_path.find_last_of("/\\") + 1);



C++17

std::filesystem::path.filename()

例如:

  

std::filesystem::path("/foo/bar.txt").filename()

标签: none

评论已关闭