Search code examples
lualua-table

How do i read strings on separate lines


I'm trying to read strings on separate lines/space as title says.

I have a row on phpmyadmin which is:

As the image under

I have a made a function to get the list value on Lua and the next step would be to read every name separately and thats what i can't figure it out.

Its possible to read every line separately and then add them to an array?

As for example local names = {Noba, Detalle}


Solution

  • Solved:

    local names = {}
    for _, name in ipairs(getList():explode("\n"))
       table.insert(names, name)
    end