java get extension
To get the file name and file extension separately we can do the string manipulation on the file name. Suppose "filename.ext" is some filename with extension is provided. To get the filename and extension we will be calculating the last index of "." and will split the file name from this ".", since characters after this "." represents the extension of the file. GetFileExtension.java is as follows:
C:\javaexamples>java GetFileExtension document.doc
File name =document
We have 1000s of tutorials on our website. Search Tutorials tutorials on our website.
Posted on: October 24, 2008 If you enjoyed this post then why not add us on Google+? Add us to your Circles