Skip to content

Instantly share code, notes, and snippets.

@fstamour
Created April 21, 2013 12:09
Show Gist options
  • Save fstamour/5429383 to your computer and use it in GitHub Desktop.
Save fstamour/5429383 to your computer and use it in GitHub Desktop.
Mini function to get the extension from a filename.
std::string getExtension( const std::string& filename ) {
size_t pos = filename.find_last_of('.');
return pos == std::string::npos? "" : filename.substr(pos);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment