-1

So I am stuck with only allowing .edu college emails on my app. I already have it set as accepting any email but I want to change it to only accept .edu emails. Anyone have a function/code that could show me on how to do this? I would really appreciate it. Thank you!

1 Answers1

0

You can check if an email address ends in ".edu" like this:

let endsInEdu = email.hasSuffix(".edu")

Note that the email address may not be valid even if this returns true.

Code
  • 6,041
  • 4
  • 35
  • 75