Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to space camel cased strings?

Asked by 4 years ago
Edited 4 years ago

I'm learning how to use spritesheets and wanted to make a mini in-game explorer. I found a table which contains most services but without any spacing in the names. Is there any way to add spaces before every capital letter? Current code (Modified to be smaller):

01local parenframe = script.Parent.Parent.Frame
02 
03-- //Create them
04 
05for i,v in pairs(ExplorerIndex) do
06    local spacedName = -- Perform string manipulation
07    if game[spacedName] then
08        -- Create the label
09    end
10end

Answer this question