B4R Question Manipulating Arrays (SD Card)

Dear All,
I'm a newbie in this forum and I tried to get experienecd with B4R. I have the need to perform searches within arrays of bytes acquired via SD.Stream (i.e. position of a string within an array).

The stream is constitued of strings and numbers separated by the comma (,).

As an example

....,Code01,Value1,Value2,Code02,Value3,.......

I wrote the code below to read from the SD Card :

B4X:
Private SDCard As SD

......

Nbytes = SDCard.Stream.BytesAvailable

Dim Testo(Nbytes) As Byte

SDCard.Stream.ReadBytes(Testo,0,Nbytes-1)

I noticed that the array received is made of bytes and I also found there's the ByteConverter.Split method that returns a SpitIterator type.

B4X:
For Each s() As Byte In bc.Split(Lista, ",")
        Log(s)
    Next

Unfortunately the method doesn't return an array, therefore I cannot access to the values in the single positions of the array.
Example if i want the value in 3 position in B4A is:
B4X:
Dim test() As String =  Regex.Split(",", Testo)
Log(test(2))

Does anyone know if there's anything similar to B4A Regex.split in B4R?

Thanks in advance

Maurizio
 
Last edited:
Top