If you are using this urls later on your code (extracting a part, querystring or etc.) please consider using
Uri class combine with HttpUtility helper.
Uri uri;
String strUrl = "http://www.test.com/test.aspx?id=53";
bool isUri = Uri.TryCreate(strUrl, UriKind.RelativeOrAbsolute, out uri);
if(isUri){
Console.WriteLine(uri.PathAndQuery.ToString());
}else{
Console.WriteLine("invalid");
}
It could help you with this operations.