【CPP】文件后缀校验 123456789101112#include <iostream>#include <string>int main(){ std::string fn = "filename.conf"; if(fn.substr(fn.find_last_of(".") + 1) == "conf") { std::cout << "Yes..." << std::endl; } else { std::cout << "No..." << std::endl; }} B_Code > CPP #CPP 【CPP】文件后缀校验 https://hodlyounger.github.io/B_Code/CPP/【CPP】文件后缀校验/ 作者 mingming 发布于 2023年10月27日 许可协议 【visual studio】编译告警常见处理手段 上一篇 【CPP】各种宏定义用法整理 下一篇