This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
BlueMond's profile picture

Lua Split

Started by BlueMond, 14 September 2013 - 09:46 AM
BlueMond #1
Posted 14 September 2013 - 11:46 AM
Can anyone suggest an efficient mock split function for lua? What I mean is splitting a string of text by a single character and storing the separated parts into a table.

Ie. split("This:is:a:test",":")
would return a table with 1 being "this" and so on.
Yevano #2
Posted 14 September 2013 - 12:21 PM
http://lua-users.org/wiki/SplitJoin explains a few ways of doing it.
BlueMond #3
Posted 14 September 2013 - 12:59 PM
Thanks