function string.split(str, delim, plain)
local tokens, pos, i, plain = {}, 1, 1, not (plain == false)
repeat
local npos, epos = str:find(delim, pos, plain)
tokens[i] = str:sub(pos, npos and npos - 1)
pos = epos and epos + 1
i = i + 1
until not pos
return tokens
end
local elements = sampGetDialogText():split('\n')
print(table.concat(elements, '\n'))