比如,获取了一个文件名为:
helloworld.cpp
那么,如何获取这个文件除后缀名外的内容?也就是:
helloworld
求解,可以用任何方式~
比如,获取了一个文件名为:
helloworld.cpp
那么,如何获取这个文件除后缀名外的内容?也就是:
helloworld
求解,可以用任何方式~
string strname="helloworld.cpp";
int n=strname.find_last_of(".");
strname=strname.substr(0,n);