c++ get extension
#include <iostream>
#include <string>
using namespace std;
string GetFileExtension(string Filename)
{
size_t LastDot = Filename.find_last_of(".");
if (LastDot == string::npos)
{
return ""; // No extension in Filename string
}
return Filename.substr(LastDot);
}
3.67
9
All C++ header extensions: .c , .h , .hpp , .hxx , .cpp , .hh
C++ file (items / source code): .cpp , .cc , .cxx
Thank you!
9
0
Are there any code examples left?
New code examples in category C++