Open main menu
Home
Random
Nearby
Log in
Settings
About Kancolle Wiki
Disclaimers
Kancolle Wiki
Search
Changes
← Older edit
Newer edit →
Module:Core
(view source)
Revision as of 12:29, 30 November 2017
223 bytes added
,
7 years ago
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