Hey guys! Well I am trying to make a simple application, not a game. The application has a strings.txt file, in which each line as a URL.
I want to put each line in an array, and then download that link and view it as a bitmap.
This is my code for reading them an putting them in an array.
local i = 1
lines = {}
for line in io.lines('strings.txt') do
lines[i] = line
print(lines[i] .. ' ' ..i)
i = i +1
end |
My issue is that the URL's are read with an additional blank line. So I can't download them. Only the last line is getting downloaded, cause it doesn't have an additional line.
Comments
(What i mean is before writing the string value to array you are reading it to variable called line in your code)
Maybe something like this:
http://lua-users.org/wiki/CommonFunctions
or
http://lua-users.org/wiki/StringLibraryTutorial
but I am sure that I pass a string to the function.
I will checkout your links now to see if I can find anything. Thanks again.
EDIT: It worked actually. I forgot to replace string in the trim function with s