I need to determine if a username in the form of an email (something@something.com) is in the correct form. The necessary parameters for the username being correct are as follows:
These are the only parameters, if they are met the method will return true and if they are all not met it will return false.
public static boolean isCorrectUsername(String username){
var atPosition = username.indexOf("@");
return atPosition > 0 && username.endsWith(".com") && username.length() > atPosition + 5;
}