function SplitMeIntolines(str)
local t = {}
local function helper(line) table.insert(t, line) return "" end
helper((str:gsub("(.-)r?n", helper)))
return t
end
function SplitMeIntolines(str)
local t = {}
local function helper(line) table.insert(t, line) return "" end
helper((str:gsub("(.-)r?n", helper)))
return t
end
It is missing some backslashes, right?
function SplitMeIntolines(str)
local t = {}
local function helper(line) table.insert(t, line) return “” end
helper((str:gsub(“(.-)\r?\n”, helper)))
return t
end
Thanks for bringing this up.
No problem. Seems to work fine now: http://tinybrain.de/1004715
You doing Lua these days? 🙂
All the best,
Stefan
Yeah, I try doing a little bit of everything. Whatever is the need of the hour 🙂
How about a warning.. this is a recursive solution. It will run out of stackmemory for real huge documents. In addition it only works for windows lineendings-
Leave a Reply