Lua实现中英文混合排序

foundwant 发布于 2014/11/04 10:43
阅读 599
收藏 0
Lua
不借助MySql数据库,不借助C、C++,不借助第三方库,想用Lua实现自己的中英文混合排序程序:
例如:下例中,对outdata中的 tag_name字段按照字母序顺序排序,排序前和排序后的结果如下:

---------------->中英文混合排序前:
1 outdata:[
2 {"user_id":"21639791","tag_name":"ooo","tag_id":"4404"},
3 {"user_id":"21639791","tag_name":"a","tag_id":"1292"},
4 {"user_id":"21639791","tag_name":"readonly","tag_id":"1056"},
5 {"user_id":"21639791","tag_name":"Sonia的小屋","tag_id":"901"},
6 {"user_id":"21639791","tag_name":"虎虎虎","tag_id":"900"},
7 {"user_id":"21639791","tag_name":"多乐family","tag_id":"898"}
8 ]
---------------->中英文混合排序后:
1 outdata:[
2 {"user_id":"21639791","tag_name":"a","tag_id":"1292"},
3 {"user_id":"21639791","tag_name":"多乐family","tag_id":"898"},
4 {"user_id":"21639791","tag_name":"虎虎虎","tag_id":"900"},
5 {"user_id":"21639791","tag_name":"ooo","tag_id":"4404"},
6 {"user_id":"21639791","tag_name":"readonly","tag_id":"1056"},
7 {"user_id":"21639791","tag_name":"Sonia的小屋","tag_id":"901"}       
8 ]
请问各位大侠们有没有什么招法?
加载中
返回顶部
顶部