iOS Question Array to list

mrossen

Active Member
Licensed User
Longtime User
Hi,

Anyone knows how to get at string to array

ex.

B4X:
Dim sl As List
sl.Initialize

Dim test AsString = "1","2"

sl.AddAll(ArrayAsString(test))

I want to do sonething like this : sl.AddAll(ArrayAsString("1", "2", "3"))

Mogens
 

stevel05

Expert
Licensed User
Longtime User
Almost as you have it:

B4X:
    Dim s1 As List
    s1.Initialize
    s1.AddAll(Array As String("1","2","3"))
    For Each S As String In s1
        Log(S)
    Next

Or as a shortcut:

B4X:
    Dim s1 As List = Array As String("10","11","12")
    For Each S As String In s1
        Log(S)
    Next
 
Upvote 0

mrossen

Active Member
Licensed User
Longtime User
Hi,

Isn't it possible to get the array from a string

If I read "1","2","3" from a csv file or a txt file and want to put that into a array how do I do that

Mogens
 
Last edited:
Upvote 0
Top