Co-authored-by: Alex Tan <8013458+senpai-notices@users.noreply.github.com>
This commit is contained in:
Joe Milazzo 2023-10-24 18:25:29 -05:00 committed by GitHub
parent b753b15f8f
commit d8c52b80e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 164 additions and 71 deletions

View file

@ -38,4 +38,11 @@ public static class UrlHelper
? $"/{url}"
: url;
}
public static string? RemoveEndingSlash(string? url)
{
if (string.IsNullOrEmpty(url)) return url;
if (url.EndsWith('/')) return url.Substring(0, url.Length - 1);
return url;
}
}