Android Question Regex.Split Array Problem

Whack

New Member
Hello, I have an array called strPackets() which is a string, and I'm using regex.split to fill the array with different sections of another string (strBuffer) which are separated by Chr(4)

Code: Copy
strPackets = Regex.Split(Chr(4), strBuffer)

However, after I do this and I try to get the length of an array value, like this, it errors.

Code: Copy
If strPackets(anyvalidnumberinthearray).Length > 3 Then

What am I doing wrong? I can't get anything from that value but it definitely exists because the regex.split fills strPackets(1) with a string

Thanks in advance
 
you need to define the array that regex will split to

Code: Copy
Dim strPackets() As String
strPackets= Regex.Split(Chr(4), "lklklk lk " & Chr(4) & "lk lk lk" )
Log(strPackets(0).Length)

If strPackets(0).Length > 3 Then
Log("ok")
Else
Log("not ok")
End If

that put this in the log

Code: Copy
** Activity (main) Create, isFirst = true **


10
ok
** Activity (main) Resume **
 
Upvote 0

Similar Threads

Back
Top