I have a requirement where I need to validate a string:
String input1 = example@gmail.com , example1@gmail.com;
String input2 = example@yahoo.com , example1@gmail.com;
String input 1 == valid ::: Valid because all email ids are of same domain
String input 2 == invalid
You can build the logic in the following way. String input1 = example@gmail.com , example1@gmail.com , example1@gmail.com;
Follow the steps.
This is a simple logic, However there may be better logic to solve it.