How to get the extension of a file?
Below is an example that can be used to get the extension of a file. The code below assume that the extension is the last part of the file name after the last dot symbol. For instance if you have a file named
data.txt the extension will be
txt, but if you have a file named
2010.tar.gz the extension will be