The preceding lessons showed top-level extension functions, available to the entire project. Extension functions can be scoped just like anything else.

In this snippet, isValidEmail() is defined as being private in a UserRegistration class. Only instances of UserRegistration will be able to call isValidEmail() on a string.

You can learn more about this in:
Run Edit