Carthalion Member Licensed User Longtime User Oct 6, 2016 #1 Numbers.txt is a text file containing "1, 2, 3" I can download and save this file using TextReader. NumString = File.ReadString(File.DirRootExternal, "Numbers.txt") Label1.Text = NumString This does put each number in the label. From there, I want to save each item in the file as an individual value. Preferably as an array. I have tried File.ReadList and it only works when a file was created as a List. This does not work. Any ideas for this? Thanks, Carthalion
Numbers.txt is a text file containing "1, 2, 3" I can download and save this file using TextReader. NumString = File.ReadString(File.DirRootExternal, "Numbers.txt") Label1.Text = NumString This does put each number in the label. From there, I want to save each item in the file as an individual value. Preferably as an array. I have tried File.ReadList and it only works when a file was created as a List. This does not work. Any ideas for this? Thanks, Carthalion
M Mahares Expert Licensed User Longtime User Oct 6, 2016 #2 Code: Copy Dim arrNumString() As String =Regex.Split(",",NumString) Log(arrNumString(0)) 'displays 1 Log(arrNumString(1)) 'displays 2 Log(arrNumString(2)) 'displays 3 Upvote 0
Code: Copy Dim arrNumString() As String =Regex.Split(",",NumString) Log(arrNumString(0)) 'displays 1 Log(arrNumString(1)) 'displays 2 Log(arrNumString(2)) 'displays 3
Carthalion Member Licensed User Longtime User Oct 6, 2016 #3 Mahares said: Code: Copy Dim arrNumString() As String =Regex.Split(",",NumString) Log(arrNumString(0)) 'displays 1 Log(arrNumString(1)) 'displays 2 Log(arrNumString(2)) 'displays 3 Click to expand... It works! Thank you... Upvote 0
Mahares said: Code: Copy Dim arrNumString() As String =Regex.Split(",",NumString) Log(arrNumString(0)) 'displays 1 Log(arrNumString(1)) 'displays 2 Log(arrNumString(2)) 'displays 3 Click to expand... It works! Thank you...