Commit f46dce0
committed
feat: Add Email class to validate and parse email address input
- Prompted user to input an email address using `Scanner`.
- Performed basic email format validation by checking presence of '@' and '.'.
- If valid, extracted:
- Username (substring before '@')
- Domain name (substring after '@')
- Printed extracted username and domain name.
- Added check to verify if domain starts with "Gmail" (case-sensitive).
- Further extracted and checked if domain equals "gmail" (case-insensitive) before the '.' character.
- Closed the Scanner object to release resources.
This class offers a simple yet effective way to parse email addresses and identify Gmail domains, useful for input validation and domain-specific processing.
Signed-off-by: Somesh diwan <[email protected]>1 parent 796dd6c commit f46dce0
1 file changed
+0
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | | - | |
33 | 31 | | |
34 | 32 | | |
35 | 33 | | |
0 commit comments