I would want to sort a table alphabetically. Except numbers.
The code below shows how the table is sorted with comparator function:
function( a,b ) return a.N < b.N end
Gives me:
obj = {
[1] = {
["N"] = "Green 1";
};
[2] = {
["N"] = "Green 11";
};
[3] = {
["N"] = "Green 2";
};
[4] = {
["N"] = "Red 1";
};
}
But I want it to be sorted like this:
obj = {
[1] = {
["N"] = "Green 1";
};
[2] = {
["N"] = "Green 2";
};
[3] = {
["N"] = "Green 11";
};
[4] = {
["N"] = "Red 1";
};
}
Is it possible?