首页 > 编程语言 > 详细

逗号字符串排序

时间:2015-03-20 01:19:42      阅读:321      评论:0      收藏:0      [点我收藏+]
技术分享
 1   public String StrSort(string Str)
 2         {
 3             var tempOption = Str.TrimEnd(,).Split(,);
 4             var text = "";
 5             if (tempOption.Length > 1)
 6             {
 7                 Array.Sort(tempOption);
 8             }
 9             for (int i = 0; i < tempOption.Length; i++)
10             {
11                 if (i != tempOption.Length - 1)
12                 {
13                     text += tempOption[i] + ",";
14                 }
15                 else
16                 {
17                     text += tempOption[i];
18                 }
19             }
20             return text;
21         }
View Code

 

逗号字符串排序

原文:http://www.cnblogs.com/yuanjiehot/p/4352340.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!