iOS Question Explode a string into an array

rfresh

Well-Known Member
Licensed User
Longtime User
Is there a function to explode a string into an array?

If I have a string like this: "This is a test"

Can I explode it into an array where each element of the array contains each character?

Thank you...
 
did you try with list?

Code: Copy
Dim chuoi As String
    chuoi="This is a test"
    Dim mang As List
    mang.Initialize
    For i=0 To chuoi.Length-1
        mang.Add(chuoi.SubString2(i,i+1))
    Next
Log(mang)
 
Upvote 0
mang.Get(0)

You could also use an Array of Strings:
Code: Copy
Dim chuoi As String
chuoi = "This is a test"
Dim mang(chuoi.Length) As String
For i = 0 To chuoi.Length - 1
    mang(i) = chuoi.SubString2(i, i + 1))
Next

and then use mang(index) to access each value
 
Last edited:
Upvote 0
Back
Top