substring lua code example

Example 1: tostring lua

-- this Code Works For Roblox Lua

local Number = 10
local NumToString = tostring(Number)
local String = "hi"
local StringToString = tostring(String)

--Outputs (Types)
print(typeof(Number)) --Output: Number
print(typeof(NumToString)) -- Output: String
print(typeof(String)) --Output: String
print(typeof(StringToString)) -- Output: String

Example 2: Lua string

-- Strings are immutable. Immutable simply means unmodifiable or unchangeable.
a = 'this is a string'

Example 3: lua table of all characters

for i=32, 256 do
 chartable[i] = utf8.char(i)
end

Tags:

Lua Example