/
String:split()
String:split()
The split method on a string allows you to split a string into a Lua table as list based on the delimiter you specify.
This is very useful for many problems.
Copy paste this code into the translator:
local Fruit = "Apple,Banana,Orange";
local List = Fruit:split(",");
trace(List);
In this sample code, we’ve passed in “,” to split our list of fruits on each comma.
In the Translator’s Annotation Windows , you should see:
, multiple selections available,
Related content
The string viewing window
The string viewing window
More like this
String:sub()
String:sub()
More like this
Functions
Functions
Read with this
Colon Operator
Colon Operator
More like this
Lua tables as dictionaries
Lua tables as dictionaries
Read with this
String:find()
String:find()
More like this