toString

override fun toString(): String

Returns the string representation of this email address.


Calling from Kotlin

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

val address: EmailAddress = EmailAddress.create("contact@kotools.org")
val message = "$address" // or address.toString()
println(message) // contact@kotools.org

Calling from Java

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

final EmailAddress address =
        EmailAddress.Companion.create("contact@kotools.org");
final String message = address.toString();
System.out.println(message); // contact@kotools.org