Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# url relative path remove

var uri = new Uri(myString);

var noLastSegment = string.Format("{0}://{1}", uri.Scheme, uri.Authority);

for(int i = 0; i < uri.Segments.Length - 1; i++)
{
   noLastSegment += uri.Segments[i];
}

noLastSegment = noLastSegment.Trim("/".ToCharArray()); // remove trailing `/`
Comment

PREVIOUS NEXT
Code Example
Csharp :: entity framework attach 
Csharp :: c# mail retrieve library 
Csharp :: check the request comes from which operating system used by user in asp net core 
Csharp :: asp.net list find 
Csharp :: unity recttransform set anchor 
Csharp :: c# array accessor 
Csharp :: windows 10 see how long a program has been running 
Csharp :: C# .net JwtSecurityTokenHandler jwttoken claims to object 
Csharp :: unity using tmpro not working 
Csharp :: eleventy set default layout 
Csharp :: universities in greece 
Csharp :: partial mvc 
Csharp :: how to create a point c# 
Csharp :: list<string,string c# 
Csharp :: c# loop array back 
Csharp :: c# loop example 
Csharp :: c# second last element 
Csharp :: how to check if a number is prime or not c# 
Csharp :: c# array inst working 
Csharp :: C# convert random numbers in textBox to currency 
Csharp :: unity product.hasreceipt 
Html :: turn off autocomplete input html 
Html :: add mailto in html 
Html :: html input price 
Html :: input type that allows float number 
Html :: add title logo html 
Html :: bootstrap 5 div center 
Html :: html shell 
Html :: <noscript<p title="</noscript<img src=x onerror=alert(1)" 
Html :: bootstrap 5 align middle 
ADD CONTENT
Topic
Content
Source link
Name
7+6 =