How would I get all the letters in a string?

How would I get all letters that are in a string?

For example the string “123hello123”, i wanna get only the hello

this page should help.

local str = "123hello123"
local hello = str:gsub("%A", "")

%A matches all non-alphabetical characters and gsub replaces them with an empty string.

3 Likes

Worked perfectly, thank you!!!