How to get file extension from string in C++
来源:互联网 发布:python输入语句 编辑:程序博客网 时间:2024/04/30 16:17
#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; }}
get prefix
ofstream file2;string headerFilename = string(argv[2]);string outputPrefix = headerFilename.substr(0,headerFilename.find_first_of("."));
- How to get file extension from string in C++
- How to convert from int to string in objective c
- How to convert from int to string in objective c
- How to get file from classpath
- How to get rid of `deprecated conversion from string constant to 'char*'` warnings in GCC?
- How to get array from string contained identical symbols in Ruby?
- How to get array from string contained identical symbols in Ruby?
- How to switch from POST to GET in PHP CURL
- How to get trace file from getbfno.sql gettrcname.sql
- [cernRoot]How to get tree name from root file
- How to get file path in onActivityResult in Android 4.4
- How to get port in FTP protocol from passive mode?
- How to read data from a file in reverse order?
- How to read data from csv file in c#
- How to remove a line from a file in java?
- How to read a frame from YUV file in OpenCV?
- How to fix QX File Extension
- How to split a string to array in objective-c?
- 掌握Drupal模块开发必备的一些基础知识
- exists 效率与用法
- google为什么要求我进行验证
- Fetch Request must have an entity错误和引入coredata.framework
- 回调函数
- How to get file extension from string in C++
- 编译最新版x264的方法(2013-01-17版测试可用)
- linux rdesktop Caps Lock大小写问题
- mat数组元素的访问
- git 的使用
- XCode编译iphone时出现的问题:The identity 'iPhone Developer' doesn't match any valid certificate/private key
- Hashtable1
- IIS6.0+Tomcat整合
- c#线程,线程刷新主界面