level 9
s="hello word."
l=#s
t={}
table.insert(t,{})
for n=1,l do
local a=s:sub(n,n)
if a<"A" or a>"z" then
table.insert(t[#t],a)
table.insert(t,{})
else
table.insert(t[#t],1,a)
end
end
for k,v in ipairs(t) do
t[k]=table.concat(v)
end
print(table.concat(t))
2015年01月02日 14点01分
1
level 9
s="hello world"
r=string.gsub(s,"(%w*)",string.reverse)
print(r)
2015年01月03日 01点01分
2