Android Question regex split pipe doesnt work

techknight

Well-Known Member
Licensed User
Longtime User
I am using a pipe | as the delimiter in regex split. But its not working.

any ideas?
 
why not:
B4X:
Dim str As String = "abc|def|efg"
Dim x() As String = Regex.Split("|", str)
For Each s In x
    Log(s)
Next
 
Upvote 0
This code works correctly. I've just tried it. The output is:
Code:
Sub Activity_Click
    Dim str As String = "abc|def|efg"
    Dim x() As String = Regex.Split("\|", str)
    For Each s In x
        Log(s)
    Next
End Sub

Copying updated assets files (4)
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
abc
def
efg
 
Upvote 0
ok ill have to check the string coming from the server then to see if something is wrong with that. Maybe ill need to run some regex thing to clean up non printable characters.
 
Upvote 0

Similar Threads

Back
Top