Hello everyone, long time no see.
I am writing a method that is supposed to check whether or not someone is over 35. The method is given a birth date as a
String (DD.MM.YYYY). This is exported from a different program, so I can't change that part. The method should return true, if the date given represents someone over 35
I would like to split that String using the "." as a separator and then parse the numbers to ints, making them comparable to the current date. Anyone turning 35 this quarter of the year will already be considered 35, even if the exact date is yet to come.
Here is the code so far:
My problem is that birhdateArray comes back empty. I would expect a String[3] with the values (for example) birthdateArray[0]==24, birthdateArray[1]==5, and birthdateArray[2]==1963 if birhtdate was set to "24.05.1963". Instead it is String[0] with the value [].
Where am I wrong?
Thank you for your help,
Martin
P.S.: In reading this I realize that currMonth and currYear are redundant. I will remove them, but they do not concern the question.