Taylohtio/CustomNavigationProvider/CustomNavigationCommon/UrlHelper.cs

27 lines
552 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Taloyhtio.CustomNavigationCommon
{
public static class UrlHelper
{
private const string SLASH = "/";
public static string RemoveTrailingSlash(string url)
{
if (string.IsNullOrEmpty(url))
{
return url;
}
if (url.EndsWith(SLASH))
{
url = url.Substring(0, url.Length - 1);
}
return url;
}
}
}