Hi I am looking for a quick and compact way to get the latest date from an ArrayList<String>
of dates which have the following format (I intend to generate this from a database). The content of the ArrayList
will have the below format
ArrayList<String> datelist=new ArrayList<String>();
datelist.add("October 09, 2019");
datelist.add("August 20, 2018");
datelist.add("October 09, 2019");
datelist.add("August 31, 2019");
the end result should be a string like October 09, 2019
any ideas regarding functions or logic will be appreciated
EDIT: Thank you all for your suggestions :). Since I needed a generic solution for a bunch of raw data processing (as it turned out while trying all your suggestions) and the above was a sample data ...issues like date mentioned in other languages as mention by @deHaar cropped up and the approach suggested by @Eritrean was most suitable for me