mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-12 02:08:27 -04:00
vars and target-typed new
This commit is contained in:
@@ -11,8 +11,8 @@ public static class StringExtensions
|
||||
{
|
||||
public static string PadBoth(this string str, int length)
|
||||
{
|
||||
int spaces = length - str.Length;
|
||||
int padLeft = spaces / 2 + str.Length;
|
||||
var spaces = length - str.Length;
|
||||
var padLeft = spaces / 2 + str.Length;
|
||||
return str.PadLeft(padLeft).PadRight(length);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user