Colon Operator

The Colon Operator (“:”) is a shorthand syntax used for calling methods on objects.

When you use the colon syntax to call a function, the object (the “self”) is automatically passed as the first argument to the function.

For example…

local Fruit = "Apple,Banana,Orange" local List = string.split(Fruit, ",") trace(List)

is equivalent to:

local Fruit = "Apple,Banana,Orange" local List = Fruit:split(",") trace(List)