fork download
  1. local title = function (str)
  2. str = tostring(str)
  3.  
  4. local cap = string.upper(str:sub(1, 1))
  5. return cap .. str:sub(2, -1)
  6. end
  7.  
  8. local butt = {"john", "jacob", "jingleheimer schmidt"}
  9.  
  10. local output = ""
  11.  
  12. for i, name in ipairs(butt) do
  13. output = output .. title(name)
  14. if i < #butt then
  15. output = output .. ", "
  16. end
  17. end
  18.  
  19. print(output)
Success #stdin #stdout 0.01s 2496KB
stdin
Standard input is empty
stdout
John, Jacob, Jingleheimer schmidt