. Advertisement .
..3..
. Advertisement .
..4..
I have a table with an varchar column. I’m trying to sort the result with only one word in the column. I’m not sure which filter to do, however splitting the values in each column is a good method. Can you tell me about Lua Split String By Space?
function Split(s, delimiter)
result = {};
for match in (s..delimiter):gmatch("(.-)"..delimiter) do
table.insert(result, match);
end
return result;
end
For example, here is one case of spliting string by space
split_string = Split("Hello ITtutoria", " ")
-- split_string[1] = "Hello"
-- split_string[2] = "ITtutoria"
In this case, you can you function Split