M Mostez Well-Known Member Licensed User Longtime User Sep 9, 2016 #1 Hello, I receive an array of ASCII bytes from asyncstream, the array is 30 bytes long. For example if I receive 'B4R' i get 3 ASCII bytes and 27 nulls. How can i trim these nulls. Thanks
Hello, I receive an array of ASCII bytes from asyncstream, the array is 30 bytes long. For example if I receive 'B4R' i get 3 ASCII bytes and 27 nulls. How can i trim these nulls. Thanks
Erel B4X founder Staff member Licensed User Longtime User Sep 9, 2016 #2 Code: Copy Sub AStream_NewData (Buffer() As Byte) Dim bc As ByteConverter Dim i As Int = bc.IndexOf(Buffer, Array As Byte(0)) If i > -1 Then Buffer = bc.SubString2(Buffer, 0, i) End If End Sub Upvote 0
Code: Copy Sub AStream_NewData (Buffer() As Byte) Dim bc As ByteConverter Dim i As Int = bc.IndexOf(Buffer, Array As Byte(0)) If i > -1 Then Buffer = bc.SubString2(Buffer, 0, i) End If End Sub
M Mostez Well-Known Member Licensed User Longtime User Sep 10, 2016 #3 thank you so much Erel Upvote 0