17,105
edits
m (Add string compare method) |
m (titleCase: Better describe function) |
||
Line 76: | Line 76: | ||
end | end | ||
-- | -- Takes an input string and returns the same string with title case-like | ||
-- | -- formatting (that is, the first letter of every word becomes uppercase, | ||
-- while the remainder becomes lowercase) | |||
-- Examples: | |||
-- titleCase('ALL CAPS') = 'All Caps' | |||
-- titleCase('all lowercase') = 'All Lowercase' | |||
-- titleCase('A MiXTUre') = 'A Mixture' | |||
-- Note that non-alphanumeric characters are treated as a word boundary, so: | |||
-- titleCase('a!b(c)d') = 'A!B(C)D' (not 'A!b(c)d') | |||
--Originally snagged this from Module:VoidByReward written by User:NoBrainz | --Originally snagged this from Module:VoidByReward written by User:NoBrainz | ||
function p.titleCase(head, tail) | function p.titleCase(head, tail) |