Duplicate :
|
|
Relates :
|
|
Relates :
|
Name: vi73552 Date: 03/26/99 When dealing with files, it is occasionally necessary to look at the extension of a file. I think a very useful potential feature of java.io.File would be some methods that allow checking of a file extension. Some methods that would be most useful are: public String getExtension() // returns the file extension, or // null if there is not one public boolean hasExtension() // returns true if the file has an // extension of the format '.xxx' // and false if the file does not // have an extension. public boolean checkExtension( String E ) // returns true if E (and only E) follows // the last period in the filename, returns // false if there is no extension or if E // doesn't match the extension (Review ID: 56140) ======================================================================
|