//Using Regex boolean checkFormat; if (input.matches("([0-9]{2})/([0-9]{2})/([0-9]{4})")) checkFormat=true; else checkFormat=false;