Sourabh Choubey

Sourabh Choubey

  • NA
  • 236
  • 41.6k

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

Sep 3 2016 3:47 AM
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)