mrossen Active Member Licensed User Longtime User Dec 21, 2014 #1 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
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 Dec 21, 2014 #2 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
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
mrossen Active Member Licensed User Longtime User Dec 22, 2014 #3 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: Dec 23, 2014 Upvote 0
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
Erel B4X founder Staff member Licensed User Longtime User Dec 23, 2014 #4 mrossen said: Isn't it possible to get the array from a string Click to expand... Why not? Either use StringUtils.LoadCSV or Regex.Split. Upvote 0
mrossen said: Isn't it possible to get the array from a string Click to expand... Why not? Either use StringUtils.LoadCSV or Regex.Split.