create

@DeprecatedAsErrorSince(version = KotoolsTypesVersion.V4_5_1)
fun create(text: String): EmailAddress

Deprecated (with error)

A better representation of email addresses exists in the `org.kotools.types` package. This one will be removed in v4.7.

Replace with

org.kotools.types.EmailAddress.fromString(text)

Creates an email address from the specified text, or throws an IllegalArgumentException if the text doesn't match the corresponding regular expression.


Calling from Kotlin

Here's an example of calling this function from Kotlin code:

val address: EmailAddress =
EmailAddress.create("[email protected]")
println(address) // [email protected]

Calling from Java

Here's an example of calling this function from Java code:

final EmailAddress address =
EmailAddress.Companion.create("[email protected]");
System.out.println(address); // [email protected]