using System;

namespace Ablera.Serdica.Authority.Extensions;

public static class StringExtensions
{
    public static string EnsureStartsWith(this string src, string prefix)
    {
        return src.StartsWith(prefix, StringComparison.OrdinalIgnoreCase) ? src : prefix + src;
    }
    public static string AppendPath(this string src, string suffix)
    {
        var d = src + suffix.EnsureStartsWith("/");
        var r = d.TrimStart('/').EnsureStartsWith("/");

        return r;
    }
}
