Commit 0f45150
committed
feat: Extract and validate email components (username and domain)
🧠 Logic:
- Given a string in email format, extract username using `substring(0, indexOf('@'))`.
- Extract domain using `substring(indexOf('@') + 1, end of string)`.
- Check if domain starts with "Gmail" and extract actual domain name (before '.') to validate.
- Used `equalsIgnoreCase("gmail")` for case-insensitive comparison.
Signed-off-by: Somesh diwan <[email protected]>1 parent 52b19bb commit 0f45150
1 file changed
+1
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | 3 | | |
5 | 4 | | |
6 | 5 | | |
7 | | - | |
8 | 6 | | |
9 | | - | |
10 | 7 | | |
11 | 8 | | |
12 | 9 | | |
13 | | - | |
14 | 10 | | |
15 | | - | |
16 | 11 | | |
17 | 12 | | |
18 | | - | |
19 | | - | |
| 13 | + | |
20 | 14 | | |
21 | 15 | | |
22 | 16 | | |
| |||
0 commit comments