toIPAddressOrNull

@JvmStatic
@JvmName(name = "getOrNull")
fun String.toIPAddressOrNull(): IPAddress?(source)

Parses a String for its IPv4 or IPv6 address.

String can be either a URL containing the IP address, or the IPv4/IPv6 address itself.

Return

IPAddress or null


@JvmStatic
@JvmName(name = "getOrNull")
fun ByteArray.toIPAddressOrNull(): IPAddress?(source)

Converts network ordered bytes to an IPv4 or IPv6 address.

Return

IPAddress or null if array size is not 4 or 16.