Hi,
I have a list of file names in an array and want to sort them by the file extension in either ascending or descending order.
I've created a bubble sort, but it's not returning the expected results.
This code takes an array of 11 files and attempts to sort they by the file extension in descending order (depending on the flag).
The expected result of this would be:
Myfile2.msg
Myfile6.msg
Myfile8.lnk
Myfile1.jpg
Myfile7.jpg
Myfile9.jpg
Myfile3.docx
Myfile4.docx
Myfile5.docx
Myfile10.docx
Myfile11.docx
But instead it returns
Myfile8.lnk
Myfile6.msg
Myfile9.jpg
Myfile2.msg
Myfile7.jpg
Myfile1.jpg
Myfile4.docx
Myfile5.docx
Myfile3.docx
Myfile10.docx
Myfile11.docx
Bookmarks