Re: word boundary \b (regular expression) in Lua
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: word boundary \b (regular expression) in Lua
- From: Shmuel Zeigerman <shmuz@...>
- Date: 2005年3月29日 20:08:50 +0200
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