Im getting the url of the current page using @CurrentPage.Url
It returns http://hostname/abcdefgh/
I wanted to trim out the last 5 characters of the URL
Req. URL http://hostname/abcd
as the last five characters 'efgh/' is removed.
I tried using @umbraco.library.TruncateString(testString,-5,"") property to trim, but was unsuccessful.
Im new to umbraco. Any help would be highly appreciated.
I'd be interested to know the reason for doing this. Using the Remove method worked for me:
@{
string url = CurrentPage.Url;
url = url.Remove(url.Length - 5);
}