@F6FF2550@YAYY1700@BA921560@MA881500@HA841430@XA42680
1)如何用正则得到@后面的数据
如:
F6FF2550
YAYY1700
BA921560
MA881500
HA841430
XA42680
2)从HA841430的第五位开始至最后一位从小到大排列
如:
680
1430
1500
1560
1700
2550

解决方案 »

  1.   

    还有怎么算出@F6FF2550@YAYY1700@BA921560@MA881500@HA841430@XA42680中有几组数据可使用!谢谢!
      

  2.   

    List<int> list = new List<int>();
                string strs = @"@F6FF2550@YAYY1700@BA921560@MA881500@HA841430@XA42680";
                Regex myrx = new Regex(@"@");
                string[] item = myrx.Split(strs);
                for (int j = 0; j < item.Length; j++)
                {
                    Console.WriteLine(item[j].ToString());
                    if (item[j].ToString().Length != 0)
                        list.Add(Convert.ToInt32(item[j].Substring(4)));
                }
                list.Sort();
                for (int x = 0; x < list.Count; x++)
                {
                    Console.WriteLine(list[x].ToString());
                }