把192.168.1.23 换成192.168.1.*

mac2022-06-30  84

 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);

转载于:https://www.cnblogs.com/antony1029/archive/2007/05/12/744021.html

最新回复(0)