private List<string> IpOrderBy(List<string> ips)
        {
            List<string> ipList = new List<string>();

            if (ips != null && ips.Count > 0)
            {
                for (int i = 0; i < ips.Count; i++)
                {
                    var ip = ips[i];
                    ip = Regex.Replace(ip, "(\\d+)", "00$1");
                    ip = Regex.Replace(ip, "0*(\\d{3})", "$1");
                    ips[i] = ip;
                }
                var ts = new SortedSet<string>(ips);

                foreach (var ip in ts)
                    ipList.Add(Regex.Replace(ip, "0*(\\d+)", "$1"));
            }
            return ipList;
        }

  

相关文章:

  • 2021-07-16
  • 2022-12-23
  • 2022-12-23
  • 2021-12-13
  • 2021-04-15
  • 2022-01-29
  • 2022-12-23
猜你喜欢
  • 2021-07-19
  • 2022-12-23
  • 2021-04-18
  • 2021-06-13
  • 2022-12-23
  • 2022-12-23
  • 2021-06-03
相关资源
相似解决方案