惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

P
Proofpoint News Feed
博客园 - 聂微东
Application and Cybersecurity Blog
Application and Cybersecurity Blog
MyScale Blog
MyScale Blog
罗磊的独立博客
H
Help Net Security
L
LangChain Blog
T
Threat Research - Cisco Blogs
量子位
S
Securelist
Last Week in AI
Last Week in AI
L
Lohrmann on Cybersecurity
T
The Exploit Database - CXSecurity.com
P
Privacy International News Feed
The Hacker News
The Hacker News
Vercel News
Vercel News
D
Darknet – Hacking Tools, Hacker News & Cyber Security
C
Cybersecurity and Infrastructure Security Agency CISA
T
The Blog of Author Tim Ferriss
T
Threatpost
Security Latest
Security Latest
P
Palo Alto Networks Blog
Microsoft Security Blog
Microsoft Security Blog
NISL@THU
NISL@THU
F
Full Disclosure
WordPress大学
WordPress大学
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Stack Overflow Blog
Stack Overflow Blog
C
Check Point Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
酷 壳 – CoolShell
酷 壳 – CoolShell
H
Heimdal Security Blog
J
Java Code Geeks
Recorded Future
Recorded Future
Hugging Face - Blog
Hugging Face - Blog
G
GRAHAM CLULEY
Know Your Adversary
Know Your Adversary
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
阮一峰的网络日志
阮一峰的网络日志
U
Unit 42
B
Blog RSS Feed
月光博客
月光博客
C
Cisco Blogs
V
Visual Studio Blog
D
DataBreaches.Net
H
Hacker News: Front Page
博客园 - 叶小钗
N
News and Events Feed by Topic
爱范儿
爱范儿
A
Arctic Wolf

博客园 - life++

multer /busboy 上传文件无法完成回调问题 linux系统上搭建egret构建环境(针对5.3.x 版以上) android studio 2.0 Gradle HttpProxy 设置 javascript的 parseInt 曾经的“陷井”在IE10上不见了,但还是得注意! 无法将类型为“xxxx”的对象强制转换为类型“Microsoft.SharePoint.WebPartPages.WebPart”。 ajax 12301 原因小结 被人忽悠完成的56.com我秀聊天室群发软件 WebDav基于Exchange2003开发邮件收发系统 fiddler 调试 WebDav 引起400错误处理 HTML-JS中的单双引混合处理原则 [笔记]443端口没开放让svn https连接不上 ora10ginstant 精简客户端遇到 system.data.oracleclient 需要 oracle 客户端软件8.1.7 或更高版本 手动调用__doPostBack('xx','') 在IE6, 下留意 javascript:void(0);问题。 让relative容器里的元素的z-index高于body下的遮照层 [原]SWFUpload 在IE9下不显示问题及IE9中模态窗下flash文件选择问题的处理 JQuery-easyui accordion 滚动条在IE6下“丢失”的处理 asp.net Ajax 页中使用jquery-easyui的显示问题处理 equal 与 == 自问自答
胡乱写个 List string 类型排序。
life++ · 2010-11-24 · via 博客园 - life++

不得不也写了个排序。 先用着。有空再改进。

structs.Sort(new Comparison<Model.TableStruct>((t1, t2) => 
            {
                var i = 0;
                var n1 = t1.ColName.ToLower();
                var n2 = t2.ColName.ToLower();

                while (n1.Length > i + 1 && n2.Length > i + 1 && n1[i] == n2[i])
                {
                    i++;
                }

                if (n1[i] > n2[i])
                    return 1;
                if (n1[i] < n2[i])
                    return -1;                
                if (n1.Length < n2.Length)
                    return -1;
                if (n1.Length > n2.Length)
                    return 1;

                return 0;
            }));
 public int CompareTo(object obj)
        {
            if (obj is TableStruct)
            {
                var t1 = this;
                var t2 = (TableStruct)obj;

                var i = 0;
                var n1 = t1.ColName.ToLower();
                var n2 = t2.ColName.ToLower();

                while (n1.Length > i + 1 && n2.Length > i + 1 && n1[i] == n2[i])
                {
                    i++;
                }

                if (n1[i] > n2[i])
                    return 1;
                if (n1[i] < n2[i])
                    return -1;
                if (n1.Length < n2.Length)
                    return -1;
                if (n1.Length > n2.Length)
                    return 1;

                return 0;
            }
            else
            {
                throw new Exception("不能比较");
            }
        }

posted @ 2010-11-24 23:45  life++  阅读(1234)  评论()    收藏  举报