[Solved] Using String#contains() and String#indexOf() to locate a date format String in a comma separated list finds incorrect matches [closed]
Currently you are not searching for a single date format in a list of date formats, you are searching for a date format String within a single String that contains multiple comma separated date formats. Since that String starts with “dd/MM/yyyy”, which contains “dd/MM/yy”, both contains and indexOf find a match (which, given your requirements, … Read more