I am trying to read a string out of an array that contains a string and a number of zero values thereafter.
results in
000000000055 with 4 squares behind it when looking at the debug watch window, and UnitInfo.Length reports as 16.
I would have thought Length should have been 12 and the zeroes would have been considered null terminations.
How can I get rid of them zeroes so UnitInfo.Serialnum will behave like a proper string?
B4X:
newbytes = GetSubArray(pk.pData, 16, 12)
UnitInfo.Serialnum = bc.StringFromBytes(newbytes,"UTF8")
results in
000000000055 with 4 squares behind it when looking at the debug watch window, and UnitInfo.Length reports as 16.
I would have thought Length should have been 12 and the zeroes would have been considered null terminations.
How can I get rid of them zeroes so UnitInfo.Serialnum will behave like a proper string?