I am new to java. I am practicing String methods currently. I wanted to check if the email contains "gmail.com" or not. This is the code I came up with
System.out.println(domain.matches(".*gmail.com(.*)"));
but dot(.) here means any character so even if i pass the string as "xyz@gmailpcom" it will return true. Basically I want to check dot(.) in the string without considering it as regular expression.