FANDOM


-- Capitalize the first letter of every word in a string.
local p = {}
 
local function titleCase( first, rest )
   return first:upper() .. rest:lower()
end
 
function p.titleCase( str )
   str = str:gsub( "(%a)([%w_']*)", titleCase )
   return str
end
 
function p.main( frame )
   local str = frame.args[ 1 ]
 
   return p.titleCase( str )
end
 
return p
Community content is available under CC-BY-SA unless otherwise noted.