Hex to Decimal - Swift
If you have a string representation, "ff"
, you can use UInt8(_:radix:)
:
let string = "ff"if let value = UInt8(string, radix: 16) { print(value)}
If you have a string representation, "ff"
, you can use UInt8(_:radix:)
:
let string = "ff"if let value = UInt8(string, radix: 16) { print(value)}