Android Question downloaded file to a list

a2stepper

Member
Licensed User
i've downloaded a file (20+ lines) with httpjog, and would like to put it in a list per line or a string array.
any suggestions.
i can get the complete file in a string in jobdone sub.
thanks.
paul allen
 

DanteS

Member
Licensed User
If you have the file in a string variable, named, for example myfile, you have to cut the string in lines (detecting the CRLF characters) and ading each line to the list

You detect the CRLF characters with n=myfile.IndexOf(chr(13) & chr(10))
You obtain the line with linex=myfile.Substring2(0,n)
You add the line to the list with mylist.Add(linex)
You truncate the rest of the file with myfile=myfile.SubString(n+2)
 

a2stepper

Member
Licensed User
Man!!! then REGEX.Split is to simple, working in 5 minutes.
i've been spending last 3 hours trying to split using all sorts of mid left and right of string.
thanks.
 
Top