parseHex

fun parseHex(hexString: String): Uuid(source)

Parses a uuid from the hexadecimal string representation as described in Uuid.toHexString.

This function is case-insensitive, and for a valid hexString, the following property holds:

val uuid = Uuid.parseHex(hexString)
assertEquals(uuid.toHexString(), hexString.lowercase())

Since Kotlin

2.0

Return

A uuid represented by the specified hexadecimal string.

Parameters

hexString

A 32-character hexadecimal string representing the uuid, without hyphens.

See also

Throws

If the hexString is not a 32-character hexadecimal string.

Samples

import kotlin.uuid.*

fun main() { 
   //sampleStart 
   val uuid = Uuid.parseHex("550E8400e29b41d4A716446655440000") // case insensitive
println(uuid) // 550e8400-e29b-41d4-a716-446655440000 
   //sampleEnd
}