Asked by Joel Borja
Alright I have these strings
String domain1 = ". com";
String domain2 = ". edu";
String domain3 = ". org";
I want to make sure that when the user puts in their username (their email) that the domain will be the last four characters. How do I get this to happen? Thank you
String domain1 = ". com";
String domain2 = ". edu";
String domain3 = ". org";
I want to make sure that when the user puts in their username (their email) that the domain will be the last four characters. How do I get this to happen? Thank you
Answers
Answered by
Steve
if (s.matches("\\.(com|edu|org)$")) {...} else {...}
There are no AI answers yet. The ability to request AI answers is coming soon!
Submit Your Answer
We prioritize human answers over AI answers.
If you are human, and you can answer this question, please submit your answer.