add EnsureEndsWith

This commit is contained in:
ig 2023-09-14 14:24:20 +02:00
parent d9c8d3e19a
commit fc77a752b4
1 changed files with 5 additions and 0 deletions

View File

@ -376,5 +376,10 @@ public static class StringUtils
return $"{prefix}{target.TrimStart(prefix)}"; return $"{prefix}{target.TrimStart(prefix)}";
} }
public static String EnsureEndsWith(this String target, String postfix)
{
return $"{target.TrimEnd(postfix)}{postfix}";
}
} }