parseHex
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())
import kotlin.uuid.*
fun main(args: Array<String>) {
//sampleStart
val uuid = Uuid.parseHex("550E8400e29b41d4A716446655440000") // case insensitive
println(uuid) // 550e8400-e29b-41d4-a716-446655440000
//sampleEnd
}
Parameters
hexString
- A 32-character hexadecimal string representing the uuid, without hyphens.
Exceptions
IllegalArgumentException
- If the hexString is not a 32-character hexadecimal string.
Return A uuid represented by the specified hexadecimal string.
See Also