mirror of
https://github.com/Tyrrrz/CliFx.git
synced 2025-10-25 15:19:17 +00:00
17 lines
388 B
C#
17 lines
388 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.Substring(0, str.Length - sub.Length);
|
|
|
|
return str;
|
|
}
|
|
} |