r/javahelp • u/SoIDKwhatmynameis • Oct 08 '20
Email checker
So i have a long comprehensive lab and i need to check if a email has .edu inside of it ive been trying mainly for() but thats all i dont really get how to check if some one can lead me in the right direction i would appreciate it.
22
Upvotes
1
u/Raph0007 Oct 08 '20
A lot of people pointed out how to simply do it with
contains()or a regex, and those are all great ideas. However, you mentioned that you tried using aforloop. If you're interested in how to implement methods likecontains()on your own (with aforloop), take a look at string search