So basically, due to the way I store what materials each mineable part gives the player when mined, I cannot have any spaces in my material names. I want the name displays to have spaces between the words in my inventory system though. Is there a function that can separate words?
local function splitTitleCaps(str)
str = str:gsub("(%u)", " %1")
return str:gsub("^%s", "")
end
local res = splitTitleCaps("MyString")
print(res) --My String
It just uses some string manipulation to split at the capital words