add EnsureEndsWith
This commit is contained in:
parent
d9c8d3e19a
commit
fc77a752b4
|
@ -375,6 +375,11 @@ 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}";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue