Skip to content

Instantly share code, notes, and snippets.

@sidishere
Created December 24, 2019 11:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sidishere/df2d414f1c9205c6f9bb972563fe8d7a to your computer and use it in GitHub Desktop.
Save sidishere/df2d414f1c9205c6f9bb972563fe8d7a to your computer and use it in GitHub Desktop.
if (dobField.getText().length()<10 || dobField.getText().length()>10) {
    dob="";
    message.setText(("Hey " + nameField.getText().toString() +
            ". You may wish to enter your birthday correctly.Your current birthday seems to be invalid"));
}
else {
    dob=dobField.getText().toString();
    message.setText(("Hey " + nameField.getText().toString() + ". You know " + monthsArray[Integer.parseInt(dobField.getText().toString().substring(3, 5)) - 1] +
            " is a really good month to start your journey on our planet."));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment