Is there a quick way to grab everything left of the question mark?
http://blah/blah/?blah
to
http://blah/blah/
Uri uri = new Uri(@"http://blah/blah/?blah");
string leftPart = uri.OriginalString.Replace(uri.Query,string.Empty);
Basically, you want to use string.Split
:
string url = @"http://blah/blah/?blah";
var parts = url.Split('?');
string bitToLeftOfQuestionMark = parts[0];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With