orNull

@DeprecatedAsErrorSince(version = KotoolsTypesVersion.V5_1_0)
@ExperimentalSince(version = KotoolsTypesVersion.V4_5_3)
fun orNull(text: String): EmailAddress?

Deprecated (with error)

Use the 'of(String)' function instead.

Replace with

import org.kotools.types.EmailAddress
EmailAddress of text

Creates an instance of EmailAddress from the specified text, or returns null if the text doesn't match the default regular expression.

This function is not available from Java code due to its non-explicit support for nullable types.

See the orThrow function for throwing an exception instead of returning null in case of invalid text.


@DeprecatedAsErrorSince(version = KotoolsTypesVersion.V5_1_0)
@ExperimentalSince(version = KotoolsTypesVersion.V5_0_1)
fun orNull(text: String, regex: EmailAddressRegex): EmailAddress?

Deprecated (with error)

Use the 'of(String, EmailAddressRegex)' function instead.

Replace with

import org.kotools.types.EmailAddress
EmailAddress.of(text, regex)

Returns an email address from the specified text, or returns null if the text doesn't match the specified regex.

This function is not available from Java code due to its non-explicit support for nullable types.

See the orThrow function for throwing an exception instead of returning null in case of invalid text.