代码
network = {
{name = "grauna", IP = "210.26.30.34"},
{name = "arraial", IP = "210.26.30.23"},
{name = "lua", IP = "210.26.23.12"},
{name = "derain", IP = "210.26.23.20"},
{name = "C++", IP = "210.26.23.22"},
}
-- 增加 string.lower 为忽略大小写。
table.sort(network, function (a,b)
return (string.lower( a.name) < string.lower(b.name))
end)
-- 将network的所有成员显示出来
for k,v in pairs(network) do
print(k,v.name)
end