mirror of
https://github.com/Tyrrrz/CliFx.git
synced 2025-10-25 15:19:17 +00:00
19 lines
371 B
C#
19 lines
371 B
C#
using System;
|
|
|
|
namespace CliFx.Analyzers.Utils.Extensions;
|
|
|
|
internal static class StringExtensions
|
|
{
|
|
public static string TrimEnd(
|
|
this string str,
|
|
string sub,
|
|
StringComparison comparison = StringComparison.Ordinal
|
|
)
|
|
{
|
|
while (str.EndsWith(sub, comparison))
|
|
str = str[..^sub.Length];
|
|
|
|
return str;
|
|
}
|
|
}
|