lua-users home
lua-l archive

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

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