RosettaCodeData/Task/Reverse-words-in-a-string/Lua/reverse-words-in-a-string-2.lua
2026-04-30 12:34:36 -04:00

7 lines
160 B
Lua

for line in io.lines"input.txt" do
local this = {}
for word in line:gmatch("%S+") do
table.insert(this, 1, word)
end
print( table.concat(this, " ") )
end