fromString

@DeprecatedAsErrorSince(version = KotoolsTypesVersion.V4_5_3)
fun fromString(text: Any): EmailAddress

Deprecated (with error)

Use the 'orThrow' method instead.

Replace with

import org.kotools.types.EmailAddress
EmailAddress.orThrow("$text")

Creates an instance of EmailAddress from the string representation of the specified text, or throws an IllegalArgumentException if the string representation of text doesn't match the default pattern.

See the fromStringOrNull method for returning null instead of throwing an exception in case of invalid text.


@DeprecatedAsErrorSince(version = KotoolsTypesVersion.V4_5_3)
fun fromString(text: Any, pattern: Any): EmailAddress

Deprecated (with error)

Use the 'orThrow' method instead.

Replace with

import org.kotools.types.EmailAddress
EmailAddress.orThrow("$text", "$pattern")

Creates an instance of EmailAddress from the string representation of the specified text. Throws an IllegalArgumentException if the string representation of text doesn't match the string representation of the specified pattern, or if the string representation of pattern doesn't match the default pattern.

See the fromStringOrNull method for returning null instead of throwing an exception in case of invalid text or pattern.