Sourabh Choubey

Sourabh Choubey

  • 1.6k
  • 236
  • 25.1k

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

Brought to you by: JavaScript SDK for Bold BI dashboard and analytics embedding. Free trial.

Answers (1)