I want to convert the unicode character to an integer and I do not get, surely it must be very easy but I do not know how to do it, if someone helps me I appreciate it.
That's is my code:
B4X:
Dim charToConvert As String = "0xf013"
'any of this
'Dim charToConvert As String = "f013"
Dim cs As CSBuilder
cs.Initialize
'next line works
cs.Typeface(Typeface.FONTAWESOME).Append(Chr(0xf013)).Pop
'next line not works because is a string, need conversion
cs.Typeface(Typeface.FONTAWESOME).Append(Chr(charToConvert)).Pop
to convert a hex string to an integer (and assuming the resulting value does not cause an overflow), use: Bit.ParseInt(hex,16)
there is a harder, more involved way to do it. you can google it at your leisure.
note: "0xf013" is not a hex string. "f013" is. f013 is not a hex value. 0xf013 is.
the conversion to a decimal value requires a hex string. you will get an exception if you use a hex value.
note: "0xf013" is not a hex string. "f013" is. f013 is not a hex value. 0xf013 is.
the conversion to a decimal value requires a hex string. you will get an exception if you use a hex value.