Lua does not have a built-in function for capitalizing strings, but you can easily accomplish this task using basic string manipulation functions.
In Lua, you concatenate strings with the .. operator.
..
In Lua, you lighten your load with string.lower().
string.lower()
In Lua, we can use the gsub function to replace occurrences of a pattern with another string – an empty string when we want to delete them.
gsub
In Lua, use the string.sub function.
string.sub
In Lua, you grab the length of a string with the # operator.
#
In Lua, use .. for concatenation or string.format for interpolation.
string.format
Here’s how to kick those quotes to the curb in Lua.
Lua’s string.gsub function is your go-to for search and replace.
string.gsub
Lua does not support regular expressions natively in the same way as languages like Perl or Python.