Created with <3 with dartpad.dev.
Last active
October 12, 2023 10:44
-
-
Save matifdeveloper/98d097b7689827d9e0d6def5aa2b9a3d to your computer and use it in GitHub Desktop.
Birthday Calculator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
String dateString = "19/8/1998"; // Replace with your date string | |
List<String> dateComponents = dateString.split('/'); | |
if (dateComponents.length == 3) { | |
int day = int.parse(dateComponents[0]); | |
int month = int.parse(dateComponents[1]); | |
print("Day: $day"); | |
print("Month: $month"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment