Question: Write a method that tests whether a file name should come before or after another. File names are first sorted by their extension (the string
Write a method that tests whether a file name should come before or after another. File names are first sorted by their extension (the string after the last period) and then by the name part (the string that remains after removing the extension). For example, before("report.doc", "notes.txt") should return true and before("report.txt","notes.txt") should return false. Provide helper methods that return the extension and name part of a file name.
Step by Step Solution
3.46 Rating (169 Votes )
There are 3 Steps involved in it
ANSWER def beforefilename1 filename2 file1ext selfextensionfilename1 file2ext ... View full answer
Get step-by-step solutions from verified subject matter experts
