Changes

no edit summary
Line 115: Line 115:  
function Utils.startsWith(s, ss)
 
function Utils.startsWith(s, ss)
 
     return string.sub(s, 1, string.len(ss)) == ss
 
     return string.sub(s, 1, string.len(ss)) == ss
 +
end
 +
 +
-- Capitalize each word in a string.
 +
function Utils.capitalize(s)
 +
    s = s:gsub("(%s)(%l)", function(a, b) return a .. string.upper(b) end)
 +
    s = s:gsub("^(%l)", function(a) return string.upper(a) end)
 +
    return s
 
end
 
end
  
cssedit, gkautomate
7,064

edits