Shared
Split a block of string to an array by separating them with the character ',' or use a custom spliter character
lib.split
lib.split(value, character)Parameter
- value
string: a value you want to split - character(optional)
string: the character you want to split by, default is ','
Return
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' }