Shared
Split a block of string to an array by separating them with the a spliter character
lib.split
lib.split(value, character)Parameters
- value
string: a value you want to split - character
string(optional): the character you want to split by, default is ','
Returns
array: a table of array
Example
lib.split('error,warning,debug')
-- return an array of { 'error', 'warning', 'debug' }lib.split('error warning debug', ' ')
-- return an array of { 'error', 'warning', 'debug' }