mirror of
https://github.com/smyalygames/kahoot-challenge-2025.git
synced 2025-05-18 13:04:14 +02:00
feat: add function to get email domain
This commit is contained in:
parent
c37111f7a5
commit
068814b8ad
@ -14,4 +14,13 @@ public class EMail {
|
|||||||
// Checks and returns if the email matches the regex pattern
|
// Checks and returns if the email matches the regex pattern
|
||||||
return pattern.matcher(email).matches();
|
return pattern.matcher(email).matches();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves the domain part of the email address
|
||||||
|
* @param email A valid email address
|
||||||
|
* @return The domain of the email address from the parameter
|
||||||
|
*/
|
||||||
|
public String getDomain(String email) {
|
||||||
|
return email.split("@")[1];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user