[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: String comparison
- From: Peter Cawley <lua@...>
- Date: Fri, 18 Dec 2009 13:34:16 +0000
On Fri, Dec 18, 2009 at 1:27 PM, Jeff Pohlmeyer
<yetanothergeek@gmail.com> wrote:
> table.sort(t, function (a, b) A=a:upper() B=b:upper() return A==B and a<b or A<B end);
a<b can be false, so the implicit-if is not appropriate. You'd have to
use an explicit-if:
table.sort(t, function (a, b)
local A,B =a:upper(), b:upper()
if A == B then return a < b
else return A < B
end end)