string.lua 165 B

12345678
  1. --localize for performance
  2. local upper = string.upper
  3. local sub = string.sub
  4. function string.capitalize_first(str)
  5. return upper(sub(str, 1, 1)) .. sub(str, 2)
  6. end