把192.168.1.23 换成192.168.1.*


 string tarIP = srcIP.Substring(0, srcIP.LastIndexOf(".") + 1) + "*";

 string[] temp = s.Split(new char[] { '.' });
            string tt = temp[0] + "." + temp[1] + "." + temp[2] + ".*";
            Console.WriteLine(tt);


            string Text = Regex.Replace("196.168.16.23", @"(\d+.\d+.\d+.)(\d+)", "$1*");
                       Console.WriteLine(Text);

antony
:antony1029@163.com
:http://antony1029.cnblogs.com
原文地址:https://www.cnblogs.com/antony1029/p/744021.html