1 | function split(s) |
2 | local result = {}
|
3 | for token in string.gmatch(s, "[^%s]+") do |
4 | table.insert(result, token) |
5 | end |
6 | return result |
7 | end |
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
| Recognizer | Recognition Result | Visualize | Recalc |
|---|---|---|---|
| #308 | 146 | [visualize] |
| Snippet ID: | #125 |
| Snippet name: | Split string (around the spaces) |
| Eternal ID of this version: | #125/1 |
| Text MD5: | 432784f93c1b1486ea208505148b9fe9 |
| Author: | stefan |
| Category: | general lua functions |
| Type: | Lua code |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2014-01-11 04:09:04 |
| Source code size: | 146 bytes / 7 lines |
| Pitched / IR pitched: | Yes / Yes |
| Views / Downloads: | 1873 / 753 |
| Referenced in: | [show references] |