lua-users home
lua-l archive

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


Hi list,

String has its metatable, so for the following code:

local str = "This Is a String"

we could just say

for w in str:gmatch("%w") do print(w) end

So my question is, when dealing with string literal, why couldn't we just say:

"a string literal":lower()

instead

("a string literal"):lower()

Is there a language reason to prevent this?

Thanks,

~hao