How to remove PROTOCOL from URI

You can use this the System.Uri class like this:

System.Uri uri = new Uri("http://stackoverflow.com/search?q=something");
string uriWithoutScheme = uri.Host + uri.PathAndQuery + uri.Fragment;

This will give you stackoverflow.com/search?q=something

Edit: this also works for about:blank 🙂

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)