iOS Question StringToBytes, or ByteConvertor in B4i?

Arf

Well-Known Member
Licensed User
Longtime User
Hi,
I haven't done any B4i programming for a while and am having a brainfail.
I'm trying to convert a MAC address string into bytes, but can't remember what the simplest way to do it is.

B4X:
manager.WriteData("49535343-FE7D-4AE5-8FA9-9FAFD205E455", "49535343-8841-43F4-A8D4-ECBE34729BB3", Array As Byte(0xA5,0x5A,0x00,0x0D,0x65, StringToBytes("D88039F0D122"),0x64))

Obviouslt that doesn't work as there seems to be a BytesToString function but not the reverse function.
Any tips gratefully received.
 

Yvon Steinthal

Active Member
Licensed User
Longtime User
B4X:
Dim listeitems as String = "Hello"
Dim bc As ByteConverter
Dim data() As Byte = bc.StringToBytes(listeitems,"UTF-8")
 
Upvote 0
Top