btcpayserver/BTCPayServer/Extensions/StringExtensions.cs
2021-12-31 16:59:02 +09:00

20 lines
532 B
C#

using System;
namespace BTCPayServer
{
public static class StringExtensions
{
public static string TrimEnd(this string input, string suffixToRemove,
StringComparison comparisonType)
{
if (input != null && suffixToRemove != null
&& input.EndsWith(suffixToRemove, comparisonType))
{
return input.Substring(0, input.Length - suffixToRemove.Length);
}
else
return input;
}
}
}