lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Zhe Hu wrote:
Hi,
I am wondering how to turn "the cat in the hat" into "The Cat In The
Hat" in pure Lua.

string.gsub (s, "(%w+)", function(a) return
  string.upper(string.sub(a,1,1)) .. string.sub(a,2) end)

--

Shmuel