Warning: file_get_contents(http://localhost:8000/calc?cmd=516&userid=0&debug=1): failed to open stream: Cannot assign requested address in /var/www/tb/show-snippet.php on line 158
splitLines test [516]

Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

11
LINES

< > BotCompany Repo | #516 // splitLines test

Lua code - System test

get("#515") -- splitLines

lines = splitLines("hello\nworld\r\nyes")

for _, l in ipairs(lines) do
  print("line: "..l)
end

assert(#lines == 3, #lines)
assert(lines[2] == 'world')
return true

test run  test run with input  download  show line numbers   

Travelled to 12 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #516
Snippet name: splitLines test
Eternal ID of this version: #516/1
Text MD5: 9414c74a0546cb99e3349a59280a9abc
Author: stefan
Category:
Type: Lua code - System test
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-03-11 15:02:29
Source code size: 202 bytes / 11 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 690 / 150
Referenced in: [show references]