[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: String comparison
- From: Jeff Pohlmeyer <yetanothergeek@...>
- Date: Fri, 18 Dec 2009 07:27:24 -0600
On Fri, Dec 18, 2009 at 7:09 AM, Matthew Wild wrote:
> table.sort(t, function (a, b) return a:upper() < b:upper() end);
That considers "Mary" and "mary" to be equal, which isn't quite right.
Maybe it should be more like:
table.sort(t, function (a, b) A=a:upper() B=b:upper() return A==B and
a<b or A<B end);
- Jeff