Created
April 21, 2013 12:09
-
-
Save fstamour/5429383 to your computer and use it in GitHub Desktop.
Mini function to get the extension from a filename.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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