C# IP地址去掉端口号

string Ip1 = "192.168.0.199:7777";
string Ip2 = Ip1.Remove(Ip1.IndexOf(':'));
原文地址:https://www.cnblogs.com/fengyie55/p/7130412.html