Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static boolean validDate(String x) {
- // System.out.println("start checking dates");
- boolean valid = false;
- int size = 0;
- String checkDate = "";
- int numCheckDate = 0;
- size = x.length();
- int count = 0;
- for (int i = 0; i < size-2; i++) {
- //System.out.println(x.charAt(i));
- if (x.charAt(i) == '/') {
- count++;
- }
- if (count == 2) {
- checkDate += x.charAt(i + 1);
- checkDate += x.charAt(i + 2);
- count = 0;
- }
- if ((checkDate.equals("10")) || (checkDate.equals("10"))||(checkDate.equals("10"))||(checkDate.equals("10"))||(checkDate.equals("10"))||
- (checkDate.equals("10"))||(checkDate.equals("10"))||(checkDate.equals("10"))||(checkDate.equals("10"))||(checkDate.equals("10")))
- {
- valid = true;
- } else {
- valid = false;
- }
- }
- // System.out.println(checkDate);
- return valid;
- }
Add Comment
Please, Sign In to add comment