String:split()

The split method on a string allows you to split a string into a 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 , you should see: