1
Answer

how to remove special character(-) from the url if the last

how to remove special character(-) from the url if the last character is - in url..
here is my one line code
<a href="@Url.RouteUrl("AbacusPage", new { catname = HttpUtility.UrlEncode(childitem.ChildName.Replace(' ', '-'))})" id="@childitem.ChildName.Replace(' ', '-').ToLower()">@childitem.ChildName</a>
here i replace the empty space with - but how to remove the last element i.e
Answers (1)