Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- http://127.0.0.1:96/Cambia3
- http://127.0.0.1/Cambia3
- var ip= new Uri("http://127.0.0.1:96/Cambia3");
- var withoutPort = string.Format("{0}://{1}/{2}", ip.Scheme, ip.Host, ip.PathAndQuery);
- var builder=new UriBuilder("http://127.0.0.1:96/Cambia3");
- builder.Port = 80;
- Console.WriteLine(builder.Uri.AbsoluteUri);
- string str = "http://127.0.0.1:96/Cambia3";
- int index1 = str.IndexOf(':', 7);
- int index2 = str.IndexOf('/', 7);
- str.Remove(index1, index2 - index1);
- UriBuilder uri = new UriBuilder("http://127.0.0.1:96/Cambia3");
- uri.Port =-1;
- string portlessurl = uri.Uri.AbsoluteUri; // Output -- http://127.0.0.1/Cambia3
- string ip = "http://127.0.0.1:96/Cambia3";
- ip = ip.Replace(":96", string.Empty);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement