How can I remove the last part of the url?


范 Taro

I have this url:https://uk.soccerway.com/national/italy/serie-a/20172018/regular-season/r42011/?ICID=TN_02_01_02

I want to remove ?ICID=TN_02_01_02because this string is dynamic so I can't use .Replace()method, any ideas?

Bryce Meister

Using Uri try to create ( https://msdn.microsoft.com/en-us/library/ms131572(v=vs.110).aspx ) to create a Uri object.

Then use that Uri object to get the "Query" property, which will contain the entire query string.

and use "AbsolutePath" to get the URL without the query string.

Related


How can I remove the last part of the url?

范 Taro I have this url:https://uk.soccerway.com/national/italy/serie-a/20172018/regular-season/r42011/?ICID=TN_02_01_02 I want to remove ?ICID=TN_02_01_02because this string is dynamic so I can't use .Replace()method, any ideas? Bryce Meister Using Uri try to

How can I retrieve the last part of the URL and use it in html?

Jim Williams Here's an example of a URL from which I'm extracting the last part, which is the person's name. yourdomain.com/?n=PERSON . i want a part " ?n= " Then use this person's name on the same HTML page. So I'll display the person's name on the web p

How can I retrieve the last part of the URL and use it in html?

Jim Williams Here's an example of a URL from which I'm extracting the last part, which is the person's name. yourdomain.com/?n=PERSON . i want a part " ?n= " Then use this person's name on the same HTML page. So I'll display the person's name on the web p

How to remove last part of URL in PHP

Nithinkumar CN $url = explode('/', $articleimage); $articleurl = array_pop($url); I have used the above method to get the last part of the URL and it works, but I want to remove the last part from the URL and show the rest, please help me, here I am mention

How to remove last part of URL using .htaccess?

Valentine P Currently, I have a url that looks like: www.mywebsite.com/confirm/ZChCQhXNJ5i The last part of the URL is a random string. I want to remove it from my url to get something like www.mywebsite.com/confirm I've tried many things, eg, RewriteRule ^(co

How to remove last part of URL in PHP

Nithinkumar CN $url = explode('/', $articleimage); $articleurl = array_pop($url); I have used the above method to get the last part of the URL and it works, but I want to remove the last part from the URL and show the rest, please help me, here I am mention

How to remove last part of URL using .htaccess?

Valentine P Currently, I have a url that looks like: www.mywebsite.com/confirm/ZChCQhXNJ5i The last part of the URL is a random string. I want to remove it from my url to get something like www.mywebsite.com/confirm I've tried many things, eg, RewriteRule ^(co

How to remove last part of URL in PHP

Nithinkumar CN $url = explode('/', $articleimage); $articleurl = array_pop($url); I have used the above method to get the last part of the URL and it works, but I want to remove the last part from the URL and show the rest, please help me, here I am mention

How to remove last part of URL in PHP

Nithinkumar CN $url = explode('/', $articleimage); $articleurl = array_pop($url); I have used the above method to get the last part of the URL and it works, but I want to remove the last part from the URL and show the rest, please help me, here I am mention

How to remove last part of URL using .htaccess?

Valentine P Currently, I have a url that looks like: www.mywebsite.com/confirm/ZChCQhXNJ5i The last part of the URL is a random string. I want to remove it from my url to get something like www.mywebsite.com/confirm I've tried many things, eg, RewriteRule ^(co

How to remove last part of URL using .htaccess?

Valentine P Currently, I have a url that looks like: www.mywebsite.com/confirm/ZChCQhXNJ5i The last part of the URL is a random string. I want to remove it from my url to get something like www.mywebsite.com/confirm I've tried many things, eg, RewriteRule ^(co

remove the last part of the url

Aquatic 7 I have some urls that look like this: https://lh5.googleusercontent.com/-Ilxb2a99p6E/AAAAAAAAAAI/AAAAAAAAAAA/AMZuucn9e4iS4IbCmDPR7UcPlz31VlV6dw/s96-c/photo.jpg This gives a 96x96 resized picture. If you delete "s96-c" and after, the original picture

How can I get the last part from a URL using regular expressions?

user enter code hereI have the following url (part of it). where i need to get the details after the final "/" /magasins/vos-magasins/le-bhv-marais /magasins/vos-magasins/le-bhv-marais-homme /magasins/vos-magasins/bhv-marais-parly2 /magasins/le-bhv-marais-la-n

How can I get the last part from a URL using regular expressions?

user enter code hereI have the following url (part of it). where i need to get the details after the final "/" /magasins/vos-magasins/le-bhv-marais /magasins/vos-magasins/le-bhv-marais-homme /magasins/vos-magasins/bhv-marais-parly2 /magasins/le-bhv-marais-la-n

How can I remove the stylesheet when I only know part of the url?

Thomas Huangism I am trying to remove CSS stylesheets using JS/jQuery. I know it will be in the 'head' element and contain the text: civicrm.css, but I don't know the rest of the URL. Is that so? if $("head:contains('civicrm.css')") { remove the entire link i

How can I remove the stylesheet when I only know part of the url?

Thomas Huangism I am trying to remove CSS stylesheets using JS/jQuery. I know it will be in the 'head' element and contain the text: civicrm.css, but I don't know the rest of the URL. Is that so? if $("head:contains('civicrm.css')") { remove the entire link i

How can I remove a specific part of an image?

Akash Tripuramallu) I have an image: original image I want to remove the grey grid part of the image without affecting the rest of the image i.e. the part inside the black circle. I have written a code for this import cv2 import numpy as np from PIL import Ima