Getting data out of a variable

CD Tom

Member
Licensed User
Longtime User
This probably is very simple but I'm not sure how to do it in b4a. I have a variable with the following information in it tom,cd,1220 what I want to do is get the tom in a variable, cd in another variable and 1220 in another variable. what the easiest way of doing this.
Thanks for any help.
 

Mahares

Expert
Licensed User
Longtime User
Tom: Use the RegEx function. Here it is:

B4X:
Dim MyVar() As String
           Dim MyStr As String= "tom,cd,1220"
           MyVar=Regex.Split(",",MyStr)
           Msgbox(MyVar(0) & CRLF & MyVar(1) & CRLF & MyVar(2),"")
 
Upvote 0
Top